Patch for the Event service as distributed with STAF 3.2.2.
This patch allows event generators to request notification from the Event service when all registered processes have acknowledged receiving the event. When generating an event, a process may give the option "NOTIFY". When all processes that should be notified of the event have acknowledged it, the Event service will queue a message to the process that generated an event. The message is a map of type STAF/Service/Event/AllAcknowledgementsReceived which contains one field "eventID" which is the ID of the event which has been acknowledged by all.
STATEMENT OF ORIGIN FOR A SINGLE CONTRIBUTOR
I, Geoff Mishkin:
(a) represent that either:
(i) I am the only author and owner of the contributed software/documentation
(described as/entitled "Notify event generator when all registrants have acknowledged"),
which was neither derived nor copied from any other software,
or
(ii) that any exception to (i) is software which was obtained under the
CPL (Common Public License), and never available under the General
Public License (GPL) or the Lesser General Public License (LGPL)
and
(b) hereby agree to license this contributed software under the CPL.
Patch for Event service
I can incorporate this patch into the next release of STAF. However, I would make the following changes:
1) Change the type of the mesage generated when all acknowledgements are received from STAF/Service/Event/AllAcknowledgementsReceived to
STAF/Service/Event/AllAcksReceived.
2) Since the message of type STAF/Service/Event/AllAcksReceived only contains one field (Event ID), there's no need to send a marshalled message so there is no need for adding a map class definition for fAllAcksRcvdMapClass. Instead, simply return the Event ID as the message.
3) When sending the STAF/Service/Event/AllAcksReceived message in method GenerationManager::ackEvent(), send the message asynchronously since you aren't checking whether the message was sent successfully or not. This reduces the time that it takes to send the message and since this ackEvent() method is synchronized, performance of the sendMessage is important.
4) Also, when sending the STAF/Service/Event/AllAcksReceived message in method GenerationManager::ackEvent(), you were specify to send the message using the priority of the last notification client (e.g. notification.client.fHow.priority) to acknowledge that they receieved the message. This didn't make any sense as each notification client could have a different priority and who knows which notification client will be the last one to acknowledge the event, so I'll change it to not specify a priority when sending the message which meana it will have the default priority of 5.
Note the patch only sends this notification message to the event generator if at least one process is registered to be notified of this event (and all registrants have ackknowledged the event and the NOTIFY option was specified on the GENERATE request). That is, it doesn't send a notification message to the event generator if no processes were registered to be notified of this event. I just wanted to verify that this was your intent.
Post if you have any comments on the changes.
My recollection of this is a bit hazy after five years but what you said all sounds good to me.