/[Sack]/trunk/lib/Sack/Server.pm
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /trunk/lib/Sack/Server.pm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 199 by dpavlin, Sun Nov 8 16:17:59 2009 UTC revision 200 by dpavlin, Sun Nov 8 16:46:19 2009 UTC
# Line 13  use Storable qw(); Line 13  use Storable qw();
13  use File::Slurp;  use File::Slurp;
14  use Cwd qw(abs_path);  use Cwd qw(abs_path);
15    
16    use lib '/srv/Sack/lib';
17    use Sack::Merge;
18    
19  my @cloud;  my @cloud;
20  my $cloud_path = $ENV{CLOUD} || die "start with: CLOUD=etc/cloud perl -I/srv/Sack/lib $0\n";  my $cloud_path = $ENV{CLOUD} || die "start with: CLOUD=etc/cloud perl -I/srv/Sack/lib $0\n";
21  @cloud = read_file $cloud_path;  @cloud = read_file $cloud_path;
# Line 109  while (1) { Line 112  while (1) {
112                                          } elsif ( $repl =~ m{view\s*(\S+)?} ) {                                          } elsif ( $repl =~ m{view\s*(\S+)?} ) {
113                                                  my $path = $1 || '/srv/Sack/views/00.demo.pl';                                                  my $path = $1 || '/srv/Sack/views/00.demo.pl';
114                                                  my $code = read_file $path;                                                  my $code = read_file $path;
115                                                    Sack::Merge->clean;
116                                                  to_all { view => $code, path => $path };                                                  to_all { view => $code, path => $path };
117                                                  $response->{view}->{$path}->{running};                                                  $response->{view}->{$path}->{running};
118                                          } elsif ( $repl =~ m{debug\s*(.+)?} ) {                                          } elsif ( $repl =~ m{debug\s*(.+)?} ) {
119                                                  to_all { debug => $1 };                                                  to_all { debug => $1 };
120                                            } elsif ( $repl =~ m{out} ) {
121                                                    my $out = Sack::Merge->out;    
122                                                    warn "out ",dump( $out );
123                                                    $response->{out} = $out;
124                                          } else {                                          } else {
125                                                  $response->{error}->{unknown} = $data;                                                  $response->{error}->{unknown} = $data;
126                                          }                                          }
# Line 130  while (1) { Line 138  while (1) {
138                                          } else {                                          } else {
139                                                  warn "no more shards for [", $data->{port}, "]\n";                                                  warn "no more shards for [", $data->{port}, "]\n";
140                                          }                                          }
141                                    } elsif ( defined $data->{out} ) {
142                                            Sack::Merge->add( $data->{out} );
143                                  } else {                                  } else {
144                                          warn "UNKNOWN ",dump($data);                                          warn "UNKNOWN ",dump($data);
145                                  }                                  }

Legend:
Removed from v.199  
changed lines
  Added in v.200

  ViewVC Help
Powered by ViewVC 1.1.26