I've added extra functions to fb extension library to handle firebird events.
The new functions are:
rb_define_method(rb_cFbConnection, "cancel_events", connection_cancel_events, 0);
rb_define_method(rb_cFbConnection, "que_events", connection_que_events, 0);
rb_define_method(rb_cFbConnection, "wait_for_events", connection_wait_for_events, 0);
rb_define_method(rb_cFbConnection, "event_counts", connection_event_counts, 0);
rb_define_method(rb_cFbConnection, "event_block", connection_event_block, 1);
They try ot mimic the firebird api functions.
cancel_events: will cancel any registered events before;
event_block: will accept an array of strings to be registered to listen, up to 15 strings can be specified.
que_events: will listen for events asynchronosly, an instance variable @_events_received will be incremented every time
the server notifys event ocurrences.
event_counts : will return an array of integers correspndig to the submitted array of strings passed to event_block,
where if the value is bigger than zero mean that the event on that array position was posted that number of times.
wait_for_events: will wait for events synchronosly, that mean will not return till any registered event occurred.
An example of usage will follow soon ! |