Continuous Processing with isc_que_events()
Go Up to Working with Events
isc_que_events()
is called to request asynchronous notification of events listed in an event buffer passed as an argument. Upon completion of the call, but before any events are posted, control is returned to the calling application so that it can continue processing.
When a requested event is posted, InterBase calls an asynchronous trap (AST) function, also passed as a parameter to isc_que_events()
, to handle the posting. The AST is a function or subroutine in the calling application, the sole purpose of which is to process the event posting for the application.
The syntax for isc_que_events()
is:
ISC_STATUS isc_que_events(ISC_STATUS *status_vector,
isc_db_handle *db_handle,
ISC_LONG *event_id,
short length,
char *event_buffer,
isc_callback event_function,
void *event_function_arg);
event_id
is a long pointer that is used as a handle in subsequent calls to isc_cancel_events
() to terminate event notification. It need not be initialized when passed. The length
parameter is the size of event_buffer
, which contains the current count of events to be waited upon. event_function
is a pointer to the AST function that InterBase should call when an event of interest is posted. It is up to the AST function to notify the application that it has been called, perhaps by setting a global flag of some kind. event_function_arg
is a pointer to the first parameter to pass to the AST.
For a complete example of a call to isc_que_events()
and a call to an AST, see A Complete isc_que_events() Example.