llen, _sock_send
[perl-Redis.git] / lib / Redis.pm
index ba87488..5a62fbf 100644 (file)
@@ -75,6 +75,12 @@ sub _sock_ok {
        confess dump($ok) unless $ok eq "+OK\r\n";
 }
 
        confess dump($ok) unless $ok eq "+OK\r\n";
 }
 
+sub _sock_send {
+       my $self = shift;
+       print $sock join(' ',@_) . "\r\n";
+       _sock_result();
+}
+
 sub _sock_send_bulk {
        my ( $self, $command, $key, $value ) = @_;
        print $sock "$command $key " . length($value) . "\r\n$value\r\n";
 sub _sock_send_bulk {
        my ( $self, $command, $key, $value ) = @_;
        print $sock "$command $key " . length($value) . "\r\n$value\r\n";
@@ -279,6 +285,17 @@ sub lpush {
        $self->_sock_send_bulk('LPUSH', $key, $value);
 }
 
        $self->_sock_send_bulk('LPUSH', $key, $value);
 }
 
+=head2 llen
+
+  $r->llen( $key );
+
+=cut
+
+sub llen {
+       my ( $self, $key ) = @_;
+       $self->_sock_send( 'llen', $key );
+}
+
 =head1 AUTHOR
 
 Dobrica Pavlinusic, C<< <dpavlin at rot13.org> >>
 =head1 AUTHOR
 
 Dobrica Pavlinusic, C<< <dpavlin at rot13.org> >>