added do with json decode
authorDobrica Pavlinusic <dpavlin@rot13.org>
Sun, 13 Mar 2011 17:20:32 +0000 (18:20 +0100)
committerDobrica Pavlinusic <dpavlin@rot13.org>
Sun, 13 Mar 2011 17:20:32 +0000 (18:20 +0100)
lib/APKPM/Gearman/Client.pm

index 0347557..61930d7 100644 (file)
@@ -26,4 +26,12 @@ sub do_background_json {
        $self->gc->dispatch_background( $func, JSON::XS::encode_json($args) );
 }
 
+sub do {
+       my ( $self, $func, $args ) = @_;
+       warn "# do ",dump( $func,$args );
+       my $ret = $self->gc->do_task( $func, $args );
+       warn "## $func $args = ",dump($ret);
+       return JSON::XS::decode_json $$ret;
+}
+
 1;