|
SObjectizer
5.7
|
New format for event- and signal handlers are supported since v.5.3.0.
The first major change: handlers could return values now. So it is possible to write a handler like this:
It allows to use handler as traditional event-handler and as service request handler.
The second major change: handlers could receive arguments without so_5::rt::event_data_t wrapper. It especially useful for event handlers:
Such event handler is subscribed as usual:
Signal handler also could has a new form:
But is must be subscribed by new version of so_subscribe().event() chain:
The main difference between old and new form is impossibility to redirect the same message to another mbox. Old form allows this by make_reference method of event_data_t:
New form handlers cannot do that. So if it is necessary to redirects the same message to another mbox than old form event handler must be used.
The third major change: lambda-functions could be used as event- and signal-handlers:
Note. The lambda-functions with event_data_t-wrapper as argument are not supported now. Old-format event handlers must be used instead.
1.8.14