summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan Vrátil <dvratil@redhat.com>2015-04-03 18:52:17 +0200
committerDan Vrátil <dvratil@redhat.com>2015-04-04 20:44:17 +0200
commit64df12d07dc601d1af660cf50fbd4540d8b5e96e (patch)
tree2c8930844dbde4a66468ec5917f89bf63c17befa
parent27bc3300d670d65b9c5332308605ef8263c3939c (diff)
downloadsink-64df12d07dc601d1af660cf50fbd4540d8b5e96e.tar.gz
sink-64df12d07dc601d1af660cf50fbd4540d8b5e96e.zip
Async: update components and lifetime documentation
-rw-r--r--async/src/async.h17
1 files changed, 10 insertions, 7 deletions
diff --git a/async/src/async.h b/async/src/async.h
index c316639..89ca0d0 100644
--- a/async/src/async.h
+++ b/async/src/async.h
@@ -46,15 +46,18 @@
46 * that can be stored and executed later on. Jobs can be composed, similarly to functions. 46 * that can be stored and executed later on. Jobs can be composed, similarly to functions.
47 * 47 *
48 * Relations between the components: 48 * Relations between the components:
49 * * Job: description of what should happen 49 * * Job: API wrapper around Executors chain. Can be destroyed while still running,
50 * * Executor: Running execution of a job, the process that calculates the result. 50 * because the actual execution happens in the background
51 * * Executor: Describes task to execute. Executors form a linked list matching the
52 * order in which they will be executed. The Executor chain is destroyed when
53 * the parent Job is destroyed. However if the Job is still running it is
54 * guaranteed that the Executor chain will not be destroyed until the execution
55 * is finished.
56 * * Execution: The running execution of the task stored in Executor. Each call to Job::exec()
57 * instantiates new Execution chain, which makes it possible for the Job to be
58 * executed multiple times (even in parallel).
51 * * Future: Representation of the result that is being calculated 59 * * Future: Representation of the result that is being calculated
52 * 60 *
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 * 61 *
59 * TODO: Composed progress reporting 62 * TODO: Composed progress reporting
60 * TODO: Possibility to abort a job through future (perhaps optional?) 63 * TODO: Possibility to abort a job through future (perhaps optional?)