For this to be effective, the sender has to batch notifications where appropriate and the receiver has to request its connection to deliver batched notifications.
A sender creates batched notifications by bracketing calls to Notify with calls to BeginNotification and EndNotification. All notifications issued between these calls are collected and sent, contained in a single instance of TBatchNotification, to receivers that are set up to receive batched notifications.
A receiver sets up to receive batched notifications by calling its connection's SetBatchedNotify member function. Generally, this is done when first setting up the connection and then it is never changed.
Design a receiver explicitly to receive batched notifications. Once a receiver has requested batched notifications, all notifications it receives are batched, whether or not the sender originally batched them. Conversely, a receiver that has not requested batched notifications always receives single notifications, regardless of how the sender sends them. This design allows you to modify the sender's code later: to change its policy about batching notifications without breaking any receivers--those designed to receive batched notifications still do so and those that were not so designed still receive individual notifications.
Normally, a receiver handles batched notifications by setting up an internal state (such as an area for invalidation) and then dispatching the notifications individually using DispatchNotifications. Afterward, the receiver examines the state and takes appropriate action.
[Contents]
[Previous]
[Next]
Click the icon to mail questions or corrections about this material to Taligent personnel.