[Eventmachine-talk] Erlang-like Processes

Kirk Haines
Tue, 28 Aug 2007 06:48:30 -0000

On 8/28/07, Francis Cianfrocca <garbagecat10 at gmail.com> wrote:

> If you really want to use that style, however, EM has another
> lightweight-concurrency feature called "Deferrable." This is
inspired
> directly by the "deferred" object in Python''s Twisted.
EM Deferrable is very
> useful and very graceful, but rather weird conceptually, so it needs its
own
> documentation (which hasn''t been written yet). It ultimately
provides the
> same functionality as spawned processes, but packaged in a way that makes
it
> easier to "return values" to code that invokes lengthy
operations. And of
> course, it also runs without threads.

If you want to see an example of a Deferrable in action, they figure
prominently in the Swiftiply code, which Francis contributed, to
handle delivering a file via chunked encoding.  It''s pretty neat.


Kirk Haines