Project
Loading...
Searching...
No Matches
o2::framework::WSDriverClient Class Reference

#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 ()
 
- Public Member Functions inherited from o2::framework::DriverClient
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 Public Attributes inherited from o2::framework::DriverClient
static constexpr ServiceKind service_kind = ServiceKind::Global
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ WSDriverClient()

o2::framework::WSDriverClient::WSDriverClient ( ServiceRegistryRef  registry,
char const *  ip,
unsigned short  port 
)

Definition at line 220 of file WSDriverClient.cxx.

◆ ~WSDriverClient()

o2::framework::WSDriverClient::~WSDriverClient ( )

Definition at line 243 of file WSDriverClient.cxx.

Member Function Documentation

◆ flushPending()

void o2::framework::WSDriverClient::flushPending ( ServiceRegistryRef  mainThreadRef)
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.

◆ mutex()

std::mutex & o2::framework::WSDriverClient::mutex ( )
inline

Definition at line 49 of file WSDriverClient.h.

◆ sendHandshake()

void o2::framework::WSDriverClient::sendHandshake ( )

FIXME: nonce should be random

Definition at line 258 of file WSDriverClient.cxx.

◆ setConnection()

void o2::framework::WSDriverClient::setConnection ( uv_connect_t connection)
inline

Definition at line 46 of file WSDriverClient.h.

◆ setDPLClient()

void o2::framework::WSDriverClient::setDPLClient ( std::unique_ptr< WSDPLClient client)

Definition at line 252 of file WSDriverClient.cxx.

◆ tell()

void o2::framework::WSDriverClient::tell ( const char msg,
size_t  s,
bool  flush = true 
)
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.


The documentation for this class was generated from the following files: