diff options
author | Christian Mollekopf <chrigi_1@fastmail.fm> | 2015-03-31 12:09:21 +0200 |
---|---|---|
committer | Christian Mollekopf <chrigi_1@fastmail.fm> | 2015-03-31 12:09:21 +0200 |
commit | ef9e47279a9d066ccb93ff1946d20d3b13953957 (patch) | |
tree | 83f7dba41820e0d4e037f1b54c6344ac2480c8e6 /async/src | |
parent | 42f32ea5865c95028c577000e15e8a8631d16e74 (diff) | |
download | sink-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.h | 19 |
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 | */ |
44 | namespace Async { | 61 | namespace Async { |
45 | 62 | ||