axl_bool vortex_pull_init ( VortexCtx ctx)

Activates the pull based event notification.

This interface allows single threaded applications to better interface with vortex API. Due to is threading nature, this pull API allows single threaded design to "fetch" or "pull" pending events rather receiving a notification through a handler.

Once the PULL API is enabled, no async handler will be called. Async handlers configured will be ignored.

A proper activation sequence is described in the following example:

1 VortexCtx * client_ctx;
3 // create an indepenent client context
4 client_ctx = vortex_ctx_new ();
6 // init vortex on this context
7 if (! vortex_init_ctx (client_ctx)) {
8  printf ("ERROR: failed to init client vortex context for PULL API..\n");
9  return axl_false;
10 }
12 // now activate PULL api on this context
13 if (! vortex_pull_init (ctx)) {
14  printf ("ERROR: failed to activate PULL API after vortex initialization..\n");
15 }
17 // do some work and fetch events with vortex_pull_next_event

To stop library function, including PULL API, the usual function must be used: vortex_exit_ctx

References CONNECTION_STAGE_POST_CREATED, vortex_async_queue_new(), vortex_connection_set_connection_actions(), vortex_ctx_get_data(), vortex_ctx_install_cleanup(), vortex_ctx_set_channel_added_handler(), vortex_ctx_set_channel_removed_handler(), vortex_ctx_set_channel_start_handler(), vortex_ctx_set_close_notify_handler(), vortex_ctx_set_data(), vortex_ctx_set_frame_received(), vortex_event_mask_free(), vortex_listener_set_on_connection_accepted(), and vortex_pull_cleanup().