AnyEvent-FIFO

 view release on metacpan or  search on metacpan

README.md  view on Meta::CPAN


- $slot

    The name of the slot that this callback should be registered to. If $slot is
    not specified, "\_\_default\_\_" is used.

- $cb

    The callback to be executed. Receives a "guard" object, and a list of arguments, as specied in @args.

    $guard is the actually trigger that kicks the next callback to be executed, so you should keep it "alive" while you need it. For example, if you need to make an http request to declare the callback done, you should do something like this:

        $fifo->push( sub {
            my ($guard, @args) = @_;

            http_get $uri, sub {
                ...
                undef $guard; # *NOW* the callback is done
            }
        } );

lib/AnyEvent/FIFO.pm  view on Meta::CPAN


=item $slot

The name of the slot that this callback should be registered to. If $slot is
not specified, "__default__" is used.

=item $cb

The callback to be executed. Receives a "guard" object, and a list of arguments, as specied in @args.

$guard is the actually trigger that kicks the next callback to be executed, so you should keep it "alive" while you need it. For example, if you need to make an http request to declare the callback done, you should do something like this:

    $fifo->push( sub {
        my ($guard, @args) = @_;

        http_get $uri, sub {
            ...
            undef $guard; # *NOW* the callback is done
        }
    } );



( run in 0.902 second using v1.01-cache-2.11-cpan-df04353d9ac )