/[Sack]/trunk/bin/lorry.pl
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/bin/lorry.pl

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

revision 107 by dpavlin, Mon Oct 5 22:21:39 2009 UTC revision 110 by dpavlin, Mon Oct 5 23:20:43 2009 UTC
# Line 17  use Time::HiRes qw(time); Line 17  use Time::HiRes qw(time);
17  my $view   = 'views/00.demo.pl';  my $view   = 'views/00.demo.pl';
18  my $offset = 0;  my $offset = 0;
19  my $limit  = 5000;  my $limit  = 5000;
20  my $cloud_file = 'etc/lib';  my $cloud_file;
21    
22    
23  GetOptions(  GetOptions(
# Line 37  sub duration { Line 37  sub duration {
37    
38  my $lorry = Sack::Lorry->new;  my $lorry = Sack::Lorry->new;
39    
40  my @cloud = read_file $cloud_file;  my @cloud = -e $cloud_file ? read_file $cloud_file : ( 'localhost' );
41  warn "bring up cloud ",dump @cloud;  warn "bring up cloud ",dump @cloud;
42    
43  my $from  = Sack::From->new(  my $from  = Sack::From->new(
# Line 75  warn "info ",dump $info; Line 75  warn "info ",dump $info;
75    
76  warn "load status ", dump( $lorry->get_from_all );  warn "load status ", dump( $lorry->get_from_all );
77    
78    our $out;
79    
80  while ( $view ) {  while ( $view ) {
         warn dump( $lorry->view( $view ) );  
         duration 'view';  
81          print "sack> ";          print "sack> ";
82          my $cmd = <STDIN>;          my $cmd = <STDIN>;
83          last unless defined $cmd; # CTRL+D          last unless defined $cmd; # CTRL+D
         chomp($cmd);  
84          duration 'repl wait';          duration 'repl wait';
85            chomp($cmd);
86            if ( $cmd =~ m{^v} ) {
87                    $out = $lorry->view( $view );
88                    duration 'view';
89            } elsif ( $cmd =~ m{^d} ) {
90                    warn dump $out;
91                    duration 'dump';
92            } else {
93                    warn "unknown $cmd\n";
94            }
95  }  }
96    
97  warn "exit all nodes\n";  warn "exit all nodes\n";

Legend:
Removed from v.107  
changed lines
  Added in v.110

  ViewVC Help
Powered by ViewVC 1.1.26