| Action Engine
             | 
Provides the Select and SelectUntil functions for selecting a fiber to proceed if one of several cases is ready.
This file defines the thread::Select and thread::SelectUntil functions, which allow a fiber to wait for (block until) one of several cases happens to proceed, either until a specified deadline or indefinitely.
#include <absl/log/check.h>#include "thread/cases.h"Go to the source code of this file.
| Functions | |
| int | thread::SelectUntil (absl::Time deadline, const CaseArray &cases) | 
| Returns the index of the first case that is ready, or -1 if the deadline has expired without any case becoming ready. | |
| int | thread::Select (const CaseArray &cases) | 
| Returns the index of the first case that is ready, blocking until one is. | |
| 
 | inline | 
Returns the index of the first case that is ready, blocking until one is.
This is equivalent to calling SelectUntil with an infinite deadline.
| cases | The array of cases to select from. Usually passed as an initializer list. | 
| int thread::SelectUntil | ( | absl::Time | deadline, | 
| const CaseArray & | cases ) | 
Returns the index of the first case that is ready, or -1 if the deadline has expired without any case becoming ready.
Example:
| deadline | The absolute time until which to wait for a case to become ready. | 
| cases | The array of cases to select from. Usually passed as an initializer list. |