diff options
-rw-r--r-- | async/src/async.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/async/src/async.h b/async/src/async.h index 4fb4f2b..171a245 100644 --- a/async/src/async.h +++ b/async/src/async.h | |||
@@ -142,6 +142,19 @@ public: | |||
142 | template<typename Out> | 142 | template<typename Out> |
143 | Job<Out> start(ThenTask<Out> func); | 143 | Job<Out> start(ThenTask<Out> func); |
144 | 144 | ||
145 | |||
146 | /** | ||
147 | * A null job. | ||
148 | * | ||
149 | * An async noop. | ||
150 | * | ||
151 | */ | ||
152 | template<typename Out> | ||
153 | Job<Out> null() | ||
154 | { | ||
155 | return Async::start<Out>([](Async::Future<Out> &future) {future.setFinished();}); | ||
156 | } | ||
157 | |||
145 | class JobBase | 158 | class JobBase |
146 | { | 159 | { |
147 | template<typename Out, typename ... In> | 160 | template<typename Out, typename ... In> |