projects
/
APKPM.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
9c5e181
)
added do_high to execute German function as high_priority one
author
Dobrica Pavlinusic
<dpavlin@rot13.org>
Tue, 4 Oct 2011 11:34:34 +0000
(13:34 +0200)
committer
Dobrica Pavlinusic
<dpavlin@rot13.org>
Tue, 4 Oct 2011 11:34:34 +0000
(13:34 +0200)
lib/APKPM/Gearman/Client.pm
patch
|
blob
|
history
diff --git
a/lib/APKPM/Gearman/Client.pm
b/lib/APKPM/Gearman/Client.pm
index
2ab1b79
..
932bd5a
100644
(file)
--- a/
lib/APKPM/Gearman/Client.pm
+++ b/
lib/APKPM/Gearman/Client.pm
@@
-36,4
+36,15
@@
sub do {
return JSON::XS::decode_json $$ret;
}
+sub do_high {
+ my ( $self, $func, $args ) = @_;
+ warn "# do_high ",dump( $func,$args );
+
+ my $task = Gearman::Task->new( $func, \$args, { high_priority => 1 } );
+
+ my $ret = $self->gc->do_task( $task );
+ warn "## $func $args = ",dump($ret);
+ return $$ret =~ m/^{/ ? JSON::XS::decode_json($$ret) : $$ret;
+}
+
1;