diff options
author | Dan Vrátil <dvratil@redhat.com> | 2014-12-11 15:55:18 +0100 |
---|---|---|
committer | Dan Vrátil <dvratil@redhat.com> | 2014-12-11 15:55:18 +0100 |
commit | c30e9145049c52feb2de719307ebbfee0650f01b (patch) | |
tree | 6896823401fb174c0f396ec30eae6257d32f8a41 /async/src/async.cpp | |
parent | 1aee1bda9fc81c888ad18fea107c271133dd5442 (diff) | |
download | sink-c30e9145049c52feb2de719307ebbfee0650f01b.tar.gz sink-c30e9145049c52feb2de719307ebbfee0650f01b.zip |
Async: move the actual task exection into Executor implementation
As of now, Job is only front interface to a chain of Executor subclasses. Each
Executor subclass specializes for given type of execution (then, each, reduce, ...),
and the chain is then executed recursively, as we did with the original Job
implementation.
Diffstat (limited to 'async/src/async.cpp')
-rw-r--r-- | async/src/async.cpp | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/async/src/async.cpp b/async/src/async.cpp index 7e81f24..c4a88fd 100644 --- a/async/src/async.cpp +++ b/async/src/async.cpp | |||
@@ -28,13 +28,20 @@ | |||
28 | 28 | ||
29 | using namespace Async; | 29 | using namespace Async; |
30 | 30 | ||
31 | JobBase::JobBase(JobBase::JobType jobType, JobBase* prev) | 31 | JobBase::JobBase(Executor *executor) |
32 | : mPrev(prev) | 32 | : mExecutor(executor) |
33 | , mResult(0) | ||
34 | , mJobType(jobType) | ||
35 | { | 33 | { |
36 | } | 34 | } |
37 | 35 | ||
36 | JobBase::~JobBase() | ||
37 | { | ||
38 | } | ||
39 | |||
40 | void JobBase::exec() | ||
41 | { | ||
42 | mExecutor->exec(); | ||
43 | } | ||
44 | |||
38 | 45 | ||
39 | FutureBase::FutureBase() | 46 | FutureBase::FutureBase() |
40 | : mFinished(false) | 47 | : mFinished(false) |
@@ -48,6 +55,10 @@ FutureBase::FutureBase(const Async::FutureBase &other) | |||
48 | { | 55 | { |
49 | } | 56 | } |
50 | 57 | ||
58 | FutureBase::~FutureBase() | ||
59 | { | ||
60 | } | ||
61 | |||
51 | void FutureBase::setFinished() | 62 | void FutureBase::setFinished() |
52 | { | 63 | { |
53 | mFinished = true; | 64 | mFinished = true; |