/[Redis.pre-github]/lib/Redis.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 /lib/Redis.pm

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

revision 17 by dpavlin, Sun Mar 22 09:22:39 2009 UTC revision 18 by dpavlin, Sun Mar 22 09:44:30 2009 UTC
# Line 75  sub _sock_ok { Line 75  sub _sock_ok {
75          confess dump($ok) unless $ok eq "+OK\r\n";          confess dump($ok) unless $ok eq "+OK\r\n";
76  }  }
77    
78    sub _sock_send_bulk {
79            my ( $self, $command, $key, $value ) = @_;
80            print $sock "$command $key " . length($value) . "\r\n$value\r\n";
81            _sock_ok();
82    }
83    
84    
85  =head1 Connection Handling  =head1 Connection Handling
86    
87  =head2 quit  =head2 quit
# Line 110  sub ping { Line 117  sub ping {
117  =cut  =cut
118    
119  sub set {  sub set {
120          my ( $self, $k, $v, $new ) = @_;          my ( $self, $key, $value, $new ) = @_;
121          print $sock "SET" . ( $new ? 'NX' : '' ) . " $k " . length($v) . "\r\n$v\r\n";          $self->_sock_send_bulk( "SET" . ( $new ? 'NX' : '' ), $key, $value );
         _sock_ok();  
122  }  }
123    
124  =head2 get  =head2 get
# Line 249  sub dbsize { Line 255  sub dbsize {
255          _sock_result();          _sock_result();
256  }  }
257    
258    =head1 Commands operating on lists
259    
260    =head2 rpush
261    
262      $r->rpush( $key, $value );
263    
264    =cut
265    
266    sub rpush {
267            my ( $self, $key, $value ) = @_;
268            $self->_sock_send_bulk('RPUSH', $key, $value);
269    }
270    
271  =head1 AUTHOR  =head1 AUTHOR
272    
273  Dobrica Pavlinusic, C<< <dpavlin at rot13.org> >>  Dobrica Pavlinusic, C<< <dpavlin at rot13.org> >>

Legend:
Removed from v.17  
changed lines
  Added in v.18

  ViewVC Help
Powered by ViewVC 1.1.26