90 |
$sock->close; |
$sock->close; |
91 |
} else { |
} else { |
92 |
warn "<<<< ", dump($data), $/; |
warn "<<<< ", dump($data), $/; |
93 |
|
|
94 |
|
if ( my $path = $data->{shard} ) { |
95 |
|
push @{ $info->{shard}->{ $data->{port} } }, $path; |
96 |
|
} |
97 |
|
|
98 |
if ( my $repl = $data->{repl} ) { |
if ( my $repl = $data->{repl} ) { |
99 |
my $response = { repl_pid => $$ }; |
my $response = { repl_pid => $$ }; |
100 |
if ( $repl =~ m/ping/ ) { |
if ( $repl =~ m/ping/ ) { |
106 |
@shard_paths = glob "/tmp/sack/$name/*"; |
@shard_paths = glob "/tmp/sack/$name/*"; |
107 |
warn "loading shards ", dump( @shard_paths ); |
warn "loading shards ", dump( @shard_paths ); |
108 |
to_all { load => $name }; |
to_all { load => $name }; |
109 |
|
} elsif ( $repl =~ m{view\s*(\S+)?} ) { |
110 |
|
my $path = $1 || '/srv/Sack/views/00.demo.pl'; |
111 |
|
my $code = read_file $path; |
112 |
|
to_all { view => $code, path => $path }; |
113 |
|
$response->{view}->{$path}->{running}; |
114 |
|
} elsif ( $repl =~ m{debug\s*(.+)?} ) { |
115 |
|
to_all { debug => $1 }; |
116 |
} else { |
} else { |
117 |
$response->{error}->{unknown} = $data; |
$response->{error}->{unknown} = $data; |
118 |
} |
} |