12 #ifndef ROC_CTL_CONTROL_LOOP_H_
13 #define ROC_CTL_CONTROL_LOOP_H_
67 enum Phase { Phase_Prologue, Phase_Epilogue };
82 enum Phase { Phase_Prologue, Phase_Epilogue };
98 enum Phase { Phase_Prologue, Phase_Epilogue };
#define ROC_ATTR_NODISCARD
Emit warning if function result is not checked.
Base class for control endpoints.
Intrusive doubly-linked list.
Base class for non-copyable objects.
Shared ownership intrusive pointer.
Attach sink to endpoint at given URI.
AttachSink(EndpointHandle endpoint, const address::EndpointUri &uri, pipeline::SenderLoop &sink)
Set task parameters.
Attach source to endpoint at given URI.
AttachSource(EndpointHandle endpoint, const address::EndpointUri &uri, pipeline::ReceiverLoop &source)
Set task parameters.
Bind endpoint on local URI.
BindEndpoint(EndpointHandle endpoint, const address::EndpointUri &uri)
Set task parameters.
Connect endpoint on remote URI.
ConnectEndpoint(EndpointHandle endpoint, const address::EndpointUri &uri)
Set task parameters.
Create endpoint on given interface.
CreateEndpoint(address::Interface iface, address::Protocol proto)
Set task parameters.
EndpointHandle get_handle() const
Get handle of the created endpoint.
Delete endpoint, if it exists.
DeleteEndpoint(EndpointHandle endpoint)
Set task parameters.
Detach sink from endpoint.
DetachSink(EndpointHandle endpoint, pipeline::SenderLoop &sink)
Set task parameters.
Detach source from endpoint.
DetachSource(EndpointHandle endpoint, pipeline::ReceiverLoop &source)
Set task parameters.
Process pending pipeline tasks on control thread.
PipelineProcessing(pipeline::PipelineLoop &pipeline)
Set task parameters.
Subclasses for specific tasks.
void schedule_at(ControlTask &task, core::nanoseconds_t deadline, IControlTaskCompleter *completer)
Enqueue a task for asynchronous execution at given point of time. deadline defines the absolute point...
ControlLoop(netio::NetworkLoop &network_loop, core::IArena &arena)
Initialize.
ROC_ATTR_NODISCARD bool schedule_and_wait(ControlTask &task)
Enqueue a task for asynchronous execution and wait until it completes. Combines schedule() and wait()...
bool is_valid() const
Check if the object was successfully constructed.
void wait(ControlTask &task)
Wait until the task is completed.
void async_cancel(ControlTask &task)
Try to cancel scheduled task execution, if it's not executed yet.
struct EndpointHandle * EndpointHandle
Opaque endpoint handle.
void schedule(ControlTask &task, IControlTaskCompleter *completer)
Enqueue a task for asynchronous execution as soon as possible. completer will be invoked on control t...
Base class for control tasks.
Control task completion handler.
Network event loop thread.
Base class for task-based pipelines.
Intrusive doubly-linked list.
int64_t nanoseconds_t
Nanoseconds.
ControlTaskResult
Control task execution result.
Network event loop thread.
Base class for pipelines.
Shared ownership intrusive pointer.