AnyEvent-Gearman

 view release on metacpan or  search on metacpan

Changes  view on Meta::CPAN

      - return on_fail event when unexpected connection error

0.05  2009-10-31T11:25:39+09:00
      - run test both Mouse/Moose
      - remove Data::UUID dependency its no longer necessary
      - add melo to stopwords ;)
      - fix wrong deep coercion (reported by miyagawa++)

0.04  2009-10-15T10:23:42+09:00
      - melo++ did several fixes listed below
      - added the add_task_bg() API for background jobs;
      - a couple of fixes here and there:
      - the usage gearman_worker('127.0.0.1') or gearman_client('127.0.0.1')
        was failing with "modification of read-only value message";
      - Added missing dependencies: Test::Base and others. I wonder why you use Test::Base though, I don't think its maintained anymore, and the latest Test::More with the done_testing() API do most of what I liked on Test::Base;
      - fixed a bug in Worker where he would not grab a new job after being done with the first one;
      - a bit of cleanups in the test directory;

0.03002 2009-09-15T14:33:50+09:00
      - depends latest Test::TCP

lib/AnyEvent/Gearman/Client.pm  view on Meta::CPAN

    $gearman->add_task(
        $function => $workload,
        on_complete => sub {
            my $res = $_[1];
        },
        on_fail => sub {
            # job failed
        },
    );
    
    # start background job
    $gearman->add_task_bg(
        $function => $workload,
    );
    

=head1 DESCRIPTION

This is Gearman client module for AnyEvent applications.

=head1 SEE ALSO

lib/AnyEvent/Gearman/Client.pm  view on Meta::CPAN

Called when the servers reports that the task was created successfully.
Updates the Task object with the server assigned C<job_handle>.

=back

You should to set C<on_complete> and C<on_fail> at least.


=head2 add_task_bg($function, $workload, %callbacks)

Starts a new background job. The parameters are the same as
L<add_task($function, $workload, %callbacks)|add_task()>, but the only
callback that is called is C<on_created>.

    $gearman->add_task_bg(
        $function => $workload,
        on_created => sub {
            my ($task) = @_;
        },
    );



( run in 0.766 second using v1.01-cache-2.11-cpan-d8267643d1d )