Notifying the application of events

A set of RMC subroutines enables an application to register with the RMC subsystem for event notifications.

These subroutines are summarized in Monitoring command interfaces and described fully in RMC API subroutines. When calling any of these subroutines, the application identifies a callback routine. When the event expression (and optionally, the rearm event expression) evaluates to True, the RMC API will invoke the specified callback, passing it an event notification structure. The event notification structure will contain information about the event, including:
  • A timestamp that indicates when the event occurred.
  • For a resource event, the resource handle of the resource whose state change resulted in the generation of the event. For a resource class event, the name of the resource class whose state change resulted in the generation of the event.
  • The values of the attributes that are used in the event expression.
When calling the particular RMC subroutine to register an event, the application can also specify that the RMC subsystem should return additional persistent attribute information in the event notification structure.

Once an event notification has been given to the application, the application may hold the data as long as necessary, even subsequent to the return of any callback that received the data. When the event notification is no longer needed, the application must free it by calling the mc_free_response subroutine. Note that an event notification may be returned even under certain error conditions.

Once the application has registered an event with the RMC subsystem, event notification will continue until the application unregisters the event using one of the mc_unreg_event_* subroutines.

The RMC API invokes the event callback routine using a thread that the application must provide by calling the mc_dispatch subroutine. For more information on the mc_dispatch subroutine and supplying threads to the RMC API, see Providing the RMC API with one or more threads.