Inspirel banner

Programming Distributed Systems with YAMI4

8.1.1 Connection Event Notifications

One of the important features of the YAMI4 agent is the ability to report connection-related events to the user. The reported events are:

In order to enable connection event reporting, the user has to provide the callback either at the time the agent is created to the appropriately overloaded agent constructor or by calling a dedicated registering function on the agent. This is done differently in each supported programming language:

If the callback is installed, the notification is performed within the context of the thread that initiated the event - this might be the user thread for opening outgoing connection, or the internally managed worker thread for opening incoming connections or closing them due to end of stream condition. The user-provided implementation of the callback should therefore not block or delay the execution unnecessarily.