26 Jun 2019 17:22:18 UTC
- Distribution: POE-Future
- Module version: 0.04
- Source (raw)
- Browse (raw)
- How to Contribute
- Testers (354 / 0 / 0)
- KwaliteeBus factor: 1
- 89.29% Coverage
- License: perl_5
- Activity24 month
- Download (12.28KB)
- MetaCPAN Explorer
- Subscribe to distribution
- This version
- Latest versionPEVANS Paul Evans
use POE::Future; my $future = POE::Future->new_delay( 10 ) ->then_done( "Hello, world!" ); say $future->get;
This subclass of Future integrates with POE, allowing the
awaitmethod to block until the future is ready. It allows
POE-using code to be written that returns
Futureinstances, so that it can make full use of
Future's abilities, including Future::Utils, and also that modules using it can provide a
Future-based asynchronous interface of their own.
For a full description on how to use Futures, see the Future documentation.
$f = POE::Future->new
Returns a new leaf future instance, which will allow waiting for its result to be made available, using the
$f = POE::Future->new_delay( $after )
Returns a new leaf future instance which will become ready (with an empty result) after the specified delay time.
$f = POE::Future->new_alarm( $at )
Returns a new leaf future instance which will become ready (with an empty result) at the specified alarm time.
To create a delay or alarm timer that will fail instead of succeed, use the
my $f = POE::Future->new_delay( 20 ) ->then_fail( "Timeout" );
Paul Evans <firstname.lastname@example.org>