Manages a set of objects performing asynchronous I/O.
Definition at line 35 of file io_list.h.
template<class T , class... Args>
Create associated work if not closed.
Requirements: std::is_base_of_v<work, T> == true
Thread Safety: May be called concurrently.
Effects: Atomically creates, inserts, and returns new work T, or returns nullptr if the io_list is closed,
If the call succeeds and returns a new object, it is guaranteed that a subsequent call to close will invoke work::close on the object.
Definition at line 210 of file io_list.h.
template<class Finisher >
void ripple::io_list::close |
( |
Finisher && |
f | ) |
|
Cancel active I/O.
Thread Safety: May not be called concurrently.
Effects: Associated work is closed.
Finisher if provided, will be called when all associated work is destroyed. The finisher may be called from a foreign thread, or within the call to this function.
Only the first call to close will set the finisher.
No effect after the first call.
Definition at line 235 of file io_list.h.
template<class >
void ripple::io_list::join |
Block until the io_list stops.
Effects: The caller is blocked until the io_list is closed and all associated work is destroyed.
Thread safety: May be called concurrently.
Preconditions: No call to io_service::run on any io_service used by work objects associated with this io_list exists in the caller's call stack.
Definition at line 259 of file io_list.h.