develooper Front page | perl.perl6.language.flow | Postings from July 2005

standard asynchronous deferred-to-result syntax RFP

Thread Next
David Nicol
July 14, 2005 12:11
standard asynchronous deferred-to-result syntax RFP
Message ID:
I have uploaded asynchronous::universal::ready and
to CPAN.  They are both entirely trivial packages with a mess of
documentation.  The
idea behind them is to support asynchonous frameworks in which the
immediate result
of passing away a message is a placeholder object with a ready method
that will return
a false value until its result message comes back, at which time the
placeholder upgrades
itself to a result.

To avoid mandating true ready methods for all objects in the cosmos that might 
get returned as the result of an asynchronous function,
provides a true ready method in UNIVERSAL.

set_callback presumes two interfaces to an asynchronous framework,
for declaring a coderef that is supposed to be run when the
asynchronous function
completes.  Synchronous objects have already completed, so
runs the coderef immediately.  The other interface is a method
"callback_queue" which
would give direct, framework-dependent access to the callback queue on
an object, should
such a thing exist in the given asynchronous framework. 
returns an empty arrayref.

The hubristic hope is that authors of asynchronous frameworks will
standardize on these
interfaces:  ready, set_callback, callback_queue.

Thanks for listening, and I'll take my answer off the air. :-)

David L Nicol
Aesop's fables, with text-sensitive advertising:

Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About