Safir SDK Core
|
Class that provides a methods to postpone the reception of data from the Dob. More...
#include <Safir/Dob/ConnectionAspectPostpone.h>
Public Member Functions | |
ConnectionAspectPostpone (const ConnectionBase &connection) | |
Constructor. More... | |
void | Postpone (const bool redispatchCurrent) const |
Postpone dispatching of current callback method for the dispatched type and its subclasses. More... | |
void | ResumePostponed () const |
Resume dispatching of postponed objects. More... | |
void | IncompleteInjectionState () const |
Discard the currently dispatched injected entity instance and wait for an update. More... | |
Additional Inherited Members | |
Protected Member Functions inherited from Safir::Dob::ConnectionAspectBase | |
ConnectionAspectBase (const ConnectionBase &connection) | |
Constructor. More... | |
virtual | ~ConnectionAspectBase () |
Destructor. More... | |
long | GetControllerId () const |
Get the id of the controller. More... | |
Class that provides a methods to postpone the reception of data from the Dob.
Sometimes it can by handy for an application to postpone the reception of data received in callbacks from the Dob.
For instance, setting up a subscription can potentially give a lot of initial OnNewEntity callbacks. If the application, for each subscription response, sends a request, the out-queue will probably fill up giving an Overflow exception. In this situation the application can postpone further callbacks.
Safir::Dob::ConnectionAspectPostpone::ConnectionAspectPostpone | ( | const ConnectionBase & | connection | ) |
Constructor.
connection | The connection that you want to operate through. |
void Safir::Dob::ConnectionAspectPostpone::IncompleteInjectionState | ( | ) | const |
Discard the currently dispatched injected entity instance and wait for an update.
A create or update of an object from an external source can have produced an inconsistent entity state (from the perspective of the application, not the Dob) and this method gives the local owner the possibility to wait for the entity instance to be completly updated.
This method can be called from within the following callbacks:
The dispatching of the injected entity instance is resumed when it is updated by the external source.
void Safir::Dob::ConnectionAspectPostpone::Postpone | ( | const bool | redispatchCurrent | ) | const |
Postpone dispatching of current callback method for the dispatched type and its subclasses.
Used by a consumer to postpone dispatching of current callback method for the dispatched type and its subclasses.
This method can be called from within the following callbacks:
but NOT from the following callbacks:
The dispatching is automatically resumed when an OnNotRequestOverflow or OnNotMessageOverflow is dispatched to the application which means that the application doesn't need to invoke ResumePostponed() by itself when the original postpone has been made because of an overflow situation.
Note that the postpone only applies to the currently dispatching consumer, other consumers will not be affected by the postpone.
If you are postponing a request (OnCreateRequest, OnUpdateRequest, OnDeleteRequest or OnServiceRequest), special care must be taken to the handling of the ResponseSender object. If redispatchCurrent is to True the current ResponseSender must be discarded (you will get a new ResponseSender). If redispatchCurrent is set to False a response for the current request must be sent.
[in] | redispatchCurrent | True indicates that the currently dispatched object shall be dispatched again once the dispatching is resumed. |
void Safir::Dob::ConnectionAspectPostpone::ResumePostponed | ( | ) | const |