summaryrefslogtreecommitdiffstats
path: root/async/src
diff options
context:
space:
mode:
authorChristian Mollekopf <chrigi_1@fastmail.fm>2015-03-31 12:09:21 +0200
committerChristian Mollekopf <chrigi_1@fastmail.fm>2015-03-31 12:09:21 +0200
commitef9e47279a9d066ccb93ff1946d20d3b13953957 (patch)
tree83f7dba41820e0d4e037f1b54c6344ac2480c8e6 /async/src
parent42f32ea5865c95028c577000e15e8a8631d16e74 (diff)
downloadsink-ef9e47279a9d066ccb93ff1946d20d3b13953957.tar.gz
sink-ef9e47279a9d066ccb93ff1946d20d3b13953957.zip
Attempt of a description how async is supposed to work, failing async lifetime tests.
Diffstat (limited to 'async/src')
-rw-r--r--async/src/async.h19
1 files changed, 18 insertions, 1 deletions
diff --git a/async/src/async.h b/async/src/async.h
index 8da3daa..dc3889b 100644
--- a/async/src/async.h
+++ b/async/src/async.h
@@ -39,7 +39,24 @@
39 39
40 40
41/* 41/*
42 * TODO: instead of passing the future objects callbacks could be provided for result reporting (we can still use the future object internally 42 * API to help write async code.
43 *
44 * This API is based around jobs that take lambdas to execute asynchronous tasks. Each async operation can take a continuation,
45 * that can then be used to execute further async operations. That way it is possible to build async chains of operations,
46 * that can be stored and executed later on. Jobs can be composed, similarly to functions.
47 *
48 * Relations between the components:
49 * * Job: description of what should happen
50 * * Executor: Running execution of a job, the process that calculates the result.
51 * * Future: Representation of the result that is being calculated
52 *
53 * Lifetime:
54 * * Before a job is executed is treated like a normal value on the stack.
55 * * As soon as the job is executed, a heap allocated executor keeps the task running until complete. The associated future handle remains
56 * valid until the task is complete. To abort a job it has to be killed through the future handle.
57 * TODO: Can we tie the lifetime of the executor to the last available future handle?
58 *
59 * TODO: Progress reporting through future
43 */ 60 */
44namespace Async { 61namespace Async {
45 62