|
enum | { REGISTERED_MESSAGE_SIZE = sizeof...(Messages)
} |
|
|
| Client () |
| trivial constructor
|
|
void | messageDispatchingStartedCb (uint16_t threadSerialNumber) override |
| called before any messages got dispatched - only once More...
|
|
void | stoppedCb (std::exception const &e) override |
| callback called when this Client is taken out of message dispatching More...
|
|
bool | droppedCb () override |
| callback called after the Client is safely taken out of the Context More...
|
|
void | invokedCb (uint16_t threadSerialNumber) override |
| this callback is called all the time (frequently) 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...
|
|
void | handleRangeImpl (BufIt &it, BufIt const &end, uint16_t threadSerialNumber) override |
| internal use, don't change or override
|
|
Public Member Functions inherited from hmbdc::app::MessageHandler< CcClient, Messages... > |
void | handleMessage (MessageHead &w) |
|
| PoolConsumer (bool interestedInMessages=true) |
|
void | stopped (std::exception const &) noexcept |
|
bool | dropped () noexcept |
|
void | messageDispatchingStarted (uint16_t threadId) |
|
void | invoked (uint16_t threadId) |
|
template<typename CcClient, typename... Messages>
callback called after the Client is safely taken out of the Context
exception thrown here is ignored and return true is assumed
- Returns
- if false, this Client is added back to the Context to process messages otherwise, no more callback. You could even safely "delete this; return true;"
Reimplemented from hmbdc::pattern::PoolConsumer.
template<typename CcClient, typename... Messages>
return the name of thread that runs this client, override if necessary
this only used when the Client is running in direct mode
- Returns
- thread name - default to be hmbdc0, hmbdc1 ...
template<typename CcClient, typename... Messages>
this callback is called all the time (frequently)
used if the Client needs to do something all the time like powering another message loop
- Parameters
-
threadSerialNumber | the number indicating which thread is in action |
Reimplemented from hmbdc::pattern::PoolConsumer.
template<typename CcClient, typename... Messages>
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.
a message could only be reaching one client when using partition Context. In this case, reduce the size (reduce the greediness) might be useful
- Returns
- the max number of messages when grabbing messages to process
template<typename CcClient, typename... Messages>
void hmbdc::app::Client< CcClient, Messages >::messageDispatchingStartedCb |
( |
uint16_t |
threadSerialNumber | ) |
|
|
inlineoverridevirtual |
called before any messages got dispatched - only once
this is the place some preparation code goes to
- Parameters
-
threadSerialNumber | normally the number indicating which thread is in action, except when REGISTERED_MESSAGE_SIZE == 0 it is another undefined value |
Reimplemented from hmbdc::pattern::PoolConsumer.
template<typename CcClient, typename... Messages>
std::tuple<char const*, int> hmbdc::app::Client< CcClient, Messages >::schedSpec |
( |
| ) |
const |
|
inline |
an overrideable method. returns the schedule policy and priority, override if necessary priority is only used when policy is "SCHED_RR", or "SCHED_FIFO"
this is only used when the Client is running in direct mode supported policy are "SCHED_OTHER"(=nullptr), "SCHED_RR", "SCHED_FIFO"
- Returns
- a tuple made of schedule policy and priority, default to be SCHED_OTHER
template<typename CcClient, typename... Messages>
callback called when this Client is taken out of message dispatching
after this call the Client is still at hook from the Context point of view (until droppedCb is called), so don't delete this Client yet or add it back to the Context. any exception thrown here is ignored,
- Parameters
-
e | the exception that caused the Client to be taken out of message dispatching e could be thrown by the Client itself in a callback function to voluntarily take itself out |
Reimplemented from hmbdc::pattern::PoolConsumer.
The documentation for this struct was generated from the following file: