impl class,
More...
#include <RecvTransportEngine.hpp>
|
void | rotate () |
| if the user choose no to have a Context to manage and run the engine this method can be called from any thread from time to time to have the engine do its job More...
|
|
void | messageDispatchingStartedCb (uint16_t threadSerialNumber) override |
| start the show by schedule the message recv
|
|
void | invokedCb (size_t) HMBDC_RESTRICT override |
| this callback is called all the time (frequently) - the exact timing is after a batch of messages are dispatched. After this call returns, the previously dispatched message's addresses are no longer valid, which means if you cache the event addresses in the previous handleMessageCb()s, you cannot use those after the return of the next invokeCb function. More...
|
|
void | stoppedCb (std::exception const &e) override |
| callback called when this Client is taken out of message dispatching More...
|
|
char const * | hmbdcName () const |
| return the name of thread that runs this client, override if necessary More...
|
|
std::tuple< char const *, int > | schedSpec () const |
| an overrideable method. returns the schedule policy and priority, override if necessary priority is only used when policy is "SCHED_RR", or "SCHED_FIFO" More...
|
|
size_t | maxBatchMessageCount () const |
| an overridable method. client receives events in batches and the max batch size is controllable when running in direct mode Context. Here is to specify the max size. More...
|
|
virtual bool | droppedCb () |
| callback called after the Client is safely taken out of the Context More...
|
|
virtual | ~Client () |
| trivial
|
|
void | stopped (std::exception const &e) noexcept |
| the following are for internal use, don't change or override
|
|
|
struct | hmbdc::app::netmap::NetContext |
|
|
void | batchDone () |
| the derived user's Client has the option to stop the current batch of event dispatching. More...
|
|
template<typename OutBuffer, typename MsgArbitrator = RecvTransport::NoOpArb>
struct hmbdc::app::netmap::RecvTransportEngine< OutBuffer, MsgArbitrator >
impl class,
this needs to be created using NetContext and start in an app::Context
- Template Parameters
-
OutputBuffer | type of buffer to hold resulting network messages |
MsgArbitrator | arbitrator to decide drop or keep messages, suited to arbitrate between different recv transports. By default, keeping all |
◆ RecvTransportEngine()
template<typename OutBuffer, typename MsgArbitrator = RecvTransport::NoOpArb>
ctor
- Parameters
-
cfg | specify the details of the netmap transport |
outputBuffer | holding the results |
arb | arbitrator instance to decide which messages to drop and keep; it supports either raw netmap (udp) packet (BEFORE topic filtering) or hmbdc message (AFTER topic filtering) level arbitration depending on which one of int operator()(void* bytes, size_t len) or int operator()(TransportMessageHeader const* header) presents in the arb |
◆ invokedCb()
template<typename OutBuffer, typename MsgArbitrator = RecvTransport::NoOpArb>
this callback is called all the time (frequently) - the exact timing is after a batch of messages are dispatched. After this call returns, the previously dispatched message's addresses are no longer valid, which means if you cache the event addresses in the previous handleMessageCb()s, you cannot use those after the return of the next invokeCb function.
you can collectively process the messages received/cached so far here, or do something needs to be done all the time like powering another message loop
- Parameters
-
dispatched | the number of messages dispatched since last invokedCb called |
Reimplemented from hmbdc::app::Client< RecvTransportEngine< OutBuffer, MsgArbitrator > >.
◆ rotate()
template<typename OutBuffer, typename MsgArbitrator = RecvTransport::NoOpArb>
if the user choose no to have a Context to manage and run the engine this method can be called from any thread from time to time to have the engine do its job
thread safe and non-blocking, if the engine is already being powered by a Context, this method has no effect
◆ stoppedCb()
template<typename OutBuffer, typename MsgArbitrator = RecvTransport::NoOpArb>
◆ syncNetmap()
template<typename OutBuffer, typename MsgArbitrator = RecvTransport::NoOpArb>
sync using busy wait or poll depending on config
it turns out busy wait performance is very poor when using vale poll works mostly, but it works well only when an enough timeout is given less than 10 milli wont work well
The documentation for this struct was generated from the following file: