| 134 | |
| 135 | protected: |
| 136 | void initialize() override |
| 137 | { |
| 138 | // Stop this nonsense if nobody cares. |
| 139 | promise->future().onDiscard(defer(this, &CollectProcess::discarded)); |
| 140 | |
| 141 | foreach (const Future<T>& future, futures) { |
| 142 | future.onAny(defer(this, &CollectProcess::waited, lambda::_1)); |
| 143 | future.onAbandoned(defer(this, &CollectProcess::abandoned)); |
| 144 | } |
| 145 | } |
| 146 | |
| 147 | private: |
| 148 | void abandoned() |