![]() |
Project
|
A service API to communicate with the driver. More...
#include <DriverClient.h>
Inherited by o2::framework::TextDriverClient, and o2::framework::WSDriverClient.
Public Member Functions | |
virtual void | tell (char const *msg, size_t s, bool flush=true)=0 |
void | tell (std::string_view const &msg, bool flush=true) |
void | observe (char const *eventType, std::function< void(std::string_view)> callback) |
Request action on some eventType notified by the driver. | |
void | dispatch (std::string_view event) |
Dispatch an event. | |
virtual void | flushPending (ServiceRegistryRef mainThreadRef)=0 |
Static Public Attributes | |
static constexpr ServiceKind | service_kind = ServiceKind::Global |
A service API to communicate with the driver.
Definition at line 30 of file DriverClient.h.
void o2::framework::DriverClient::dispatch | ( | std::string_view | event | ) |
Dispatch an event.
Definition at line 23 of file DriverClient.cxx.
|
pure virtual |
Flush all pending events (if connected) Note: this must be guaranteed to be called from the main thread, because the libuv backend cannot queue write operations on a thread which is not the main one. In order to do this, one should have assert(mainTreadRef.isMainThread()) in the implementation. Notice also that if you want to use uv_async_send, you must make sure that you do not rely on having as many events as the times you called uv_async_send, because this is not guaranteed.
Implemented in o2::framework::WSDriverClient, and o2::framework::TextDriverClient.
void o2::framework::DriverClient::observe | ( | char const * | eventType, |
std::function< void(std::string_view)> | callback | ||
) |
Request action on some eventType notified by the driver.
Definition at line 18 of file DriverClient.cxx.
|
pure virtual |
Report some message to the Driver msg the message to be sent. size size of the message to be sent. flush whether the message should be flushed immediately, if possible.
Implemented in o2::framework::TextDriverClient, and o2::framework::WSDriverClient.
|
inline |
Definition at line 41 of file DriverClient.h.
|
staticconstexpr |
Definition at line 33 of file DriverClient.h.