Exposes methods to manipulate the thread context, especially future wait methods.
More...
|
virtual void | wait () const =0 |
| Waits for the future associated with this context to be ready. More...
|
|
virtual std::future_status | waitFor (std::chrono::milliseconds timeMs) const =0 |
| Waits for the future associated with this context to be ready for a maximum of 'timeMs' milliseconds. More...
|
|
virtual void | waitAt (int num) const =0 |
| Waits for the future in the 'num-th' continuation context to be ready. More...
|
|
virtual std::future_status | waitForAt (int num, std::chrono::milliseconds timeMs) const =0 |
| Waits for the future in the 'num-th' continuation context to be ready for a maximum of 'timeMs' milliseconds. More...
|
|
virtual void | waitAll () const =0 |
| Wait for all the futures in the continuation chain to be ready. More...
|
|
virtual | ~IContextBase ()=default |
| Virtual destructor. More...
|
|
virtual bool | valid () const =0 |
| Determines if the future object associated with this context has a valid shared state with the corresponding promise. More...
|
|
virtual bool | validAt (int num) const =0 |
| Determines if the future object associated with the 'num'-th continuation context is still valid. More...
|
|
virtual int | setException (std::exception_ptr ex)=0 |
| Set an exception in the promise associated with the current IThreadContext or ICoroContext. More...
|
|
Exposes methods to manipulate the thread context, especially future wait methods.
virtual std::future_status Bloomberg::quantum::IThreadContextBase::waitForAt |
( |
int |
num, |
|
|
std::chrono::milliseconds |
timeMs |
|
) |
| const |
|
pure virtual |
Waits for the future in the 'num-th' continuation context to be ready for a maximum of 'timeMs' milliseconds.
Allowed range for num is [-1, total_continuations). -1 is equivalent of calling wait() or waitAt(total_continuations-1) on the last context in the chain (i.e. the context which is returned via end()). Position 0 represents the first future in the chain.
- Parameters
-
[in] | num | The number indicating which future to wait on. |
[in] | timeMs | The maximum amount of milliseconds to wait until the future value becomes ready. |
- Returns
- 'ready' if value was posted before duration expired or 'timeout' otherwise.
- Note
- Blocks until the value is ready, until 'timeMs' duration expires or until an exception is thrown.
Implemented in Bloomberg::quantum::Context< RET >, and Bloomberg::quantum::IThreadContext< RET >.