summaryrefslogtreecommitdiffstats
path: root/common/entitybuffer.h
diff options
context:
space:
mode:
authorDan Vrátil <dvratil@redhat.com>2015-04-01 21:02:34 +0200
committerDan Vrátil <dvratil@redhat.com>2015-04-01 21:19:48 +0200
commitb01fadba903056218f2a00c5e62e1dc8df062124 (patch)
treeadca72675973ab5d8253ab14ff94949824d6523e /common/entitybuffer.h
parent94729eef71570e0b792a9afb95eeab7fd1eec56b (diff)
downloadsink-b01fadba903056218f2a00c5e62e1dc8df062124.tar.gz
sink-b01fadba903056218f2a00c5e62e1dc8df062124.zip
Async: support (re-)executing single Job multiple times
Storing Future and current Job progress directly in Executors means that we cannot re-execute finished job, or even execute the same Job multiple times in parallel. To do so, we need to make Executors stateless and track the state elsewhere. This change does that by moving the execution state from Executor to Execution class. Executors now only describe the tasks to execute, while Execution holds the current state of execution. New Execution is created every time Job::exec() is called. Execution holds reference to it's result (Future) and Executor which created the Execution. This ensures that Executor is not deleted when Job (which owns Executors) goes out of scope while the execution is still running. At the same time Future holds reference to relevant Execution, so that the Execution is deleted when all copies of Future referring result from the respective Execution are deleted.
Diffstat (limited to 'common/entitybuffer.h')
0 files changed, 0 insertions, 0 deletions