[DGD] Code libraries for DGD and Hydra

Felix A. Croes felix at dworkin.nl
Wed Sep 19 12:51:24 CEST 2018


The cloud library builds upon call_out_other to provide a higher-level
abstraction: continuations.

A continuation in the cloud library is a way to compose a larger whole
out of separate tasks.  At its lowest level, it is a data type that
represents a function to be called in the future.  The actual callout
is not created until the continuation is executed.

Continuations can be composed in several ways:
 - a chained continuation takes the return value of the preceding
   continuation as its argument
 - an iterative continuation starts a different task (sequentially)
   for every iteration of someting iterable
 - a distributed continuation abstracts the map/reduce pattern

Continuations cannot be altered after execution has begun, but a
task can arbitrarily postpone the next step of the continuation it
is in.  This makes it possible to create a top-level continuation
first, and fill in each step with finer-grained components as it is
executed.

This summary is no doubt rather vague and abstract for most readers
of this mailing list; it is intended for programmers who are already
familiar with futures, promises and other forms of delayed execution.
An example of the use of continuations can be found in the Asheron's
Call emulator project:

    https://github.com/dworkin/AsheronsFall

Regards,
Felix Croes



More information about the DGD mailing list