![]() |
Project
|
#include <WSDriverClient.h>
Inherits o2::framework::DriverClient.
Public Member Functions | |
WSDriverClient (ServiceRegistryRef registry, char const *ip, unsigned short port) | |
~WSDriverClient () | |
void | tell (const char *msg, size_t s, bool flush=true) final |
void | flushPending (ServiceRegistryRef mainThreadRef) final |
void | setDPLClient (std::unique_ptr< WSDPLClient >) |
void | setConnection (uv_connect_t *connection) |
void | sendHandshake () |
std::mutex & | mutex () |
![]() | |
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. | |
Additional Inherited Members | |
![]() | |
static constexpr ServiceKind | service_kind = ServiceKind::Global |
Communicate between driver and devices via a websocket This implementation is enabled if you pass –driver-client ws:// as an option.
Definition at line 38 of file WSDriverClient.h.
o2::framework::WSDriverClient::WSDriverClient | ( | ServiceRegistryRef | registry, |
char const * | ip, | ||
unsigned short | port | ||
) |
Definition at line 220 of file WSDriverClient.cxx.
o2::framework::WSDriverClient::~WSDriverClient | ( | ) |
Definition at line 243 of file WSDriverClient.cxx.
|
finalvirtual |
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.
Implements o2::framework::DriverClient.
Definition at line 280 of file WSDriverClient.cxx.
|
inline |
Definition at line 49 of file WSDriverClient.h.
void o2::framework::WSDriverClient::sendHandshake | ( | ) |
FIXME: nonce should be random
Definition at line 258 of file WSDriverClient.cxx.
|
inline |
Definition at line 46 of file WSDriverClient.h.
void o2::framework::WSDriverClient::setDPLClient | ( | std::unique_ptr< WSDPLClient > | client | ) |
Definition at line 252 of file WSDriverClient.cxx.
|
finalvirtual |
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.
Implements o2::framework::DriverClient.
Definition at line 264 of file WSDriverClient.cxx.