z/OS MVS Programming: Writing Servers for APPC/MVS
Previous topic | Next topic | Contents | Contact z/OS | Library | PDF


Retrieving Event Elements

z/OS MVS Programming: Writing Servers for APPC/MVS
SA23-1396-00

To retrieve the next event element on an event queue, call the Get_Event service. You can have only one outstanding call to the Get_Event service at a time. On the call to Get_Event, specify the event_get_type and notify_type parameters to indicate how APPC/MVS is to process the call, as follows:
  • Specify event_get_type to indicate whether the Get_Event service can wait for a new event element to be added to the event queue, if the event queue currently contains no elements (Get_Event waits under the caller's task.)
  • Specify notify_type to indicate whether the Get_Event call is to be processed synchronously or asynchronously.

If you set event_get_type to 1 (atbcts_immediate), APPC/MVS returns an event element if one is immediately available. If there are no event elements, APPC/MVS provides return and reason codes that show the call was unsuccessful because no event elements were available. If you specify an event_get_type of 2 (atbcts_wait), APPC/MVS waits until an event element is available before returning control.

If you call Get_Event synchronously, APPC/MVS does not return control until Get_Event completes, or you implicitly cancel the request (for example, unregistering from the allocate queue causes APPC/MVS to cancel an outstanding Get_Event request for the queue). If you call Get_Event asynchronously, APPC/MVS returns control immediately, but monitors the event queue for an event element. APPC/MVS notifies the server by posting the specified ECB when the event for which notification was requested occurs.

Table 1 shows the results for different combinations of notify_type and event_get_type:

Table 1. Results of Notify_Type/Event_Get_Type Combinations
Notify_Type Value: Event_Get_Type Value:
atbcts_immediate atbcts_wait
NONE Get_Event returns an event element if one is available, or return code 16 (atbcts_request_unsuccessful) and reason code 30 (atbcts_no_event_available), if the event queue is currently empty. The caller waits until an event element is retrieved, or this call is cancelled implicitly.
ECB Control returns to the caller immediately, while APPC/MVS processes the Get_Event call asynchronously. If the event element is available, Get_Event returns the element. Otherwise, the caller receives return code 16 (atbcts_request_unsuccessful) and reason code 30 (atbcts_no_event_available). Control returns to the caller immediately, while APPC/MVS processes the Get_Event call asynchronously. When an event element is available, Get_Event posts the caller's ECB.

Go to the previous page Go to the next page




Copyright IBM Corporation 1990, 2014