Qpid Proton C API  0.17.0
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
proactor.h File Reference

Experimental - Multithreaded IO More...

#include <proton/types.h>
#include <proton/import_export.h>
#include <proton/listener.h>

Go to the source code of this file.


typedef struct pn_proactor_t pn_proactor_t
 The proactor, see pn_proactor()


pn_proactor_tpn_proactor (void)
 Create a proactor. More...
void pn_proactor_free (pn_proactor_t *proactor)
 Free the proactor. More...
int pn_proactor_connect (pn_proactor_t *proactor, pn_connection_t *connection, const char *host, const char *port)
 Connect connection to host/port. More...
int pn_proactor_listen (pn_proactor_t *proactor, pn_listener_t *listener, const char *host, const char *port, int backlog)
 Start listening with listener. More...
pn_event_batch_tpn_proactor_wait (pn_proactor_t *proactor)
 Wait for events to handle. More...
void pn_proactor_done (pn_proactor_t *proactor, pn_event_batch_t *events)
 Call when done handling a batch of events. More...
void pn_proactor_interrupt (pn_proactor_t *proactor)
 Cause PN_PROACTOR_INTERRUPT to be returned to exactly one call of pn_proactor_wait(). More...
void pn_proactor_set_timeout (pn_proactor_t *proactor, pn_millis_t timeout)
 Cause PN_PROACTOR_TIMEOUT to be returned to a thread calling wait() after timeout milliseconds. More...
void pn_connection_wake (pn_connection_t *connection)
 Cause a PN_CONNECTION_WAKE event to be returned by the proactor, even if there are no IO events pending for the connection. More...
pn_proactor_tpn_connection_proactor (pn_connection_t *connection)
 Return the proactor associated with a connection or NULL.
pn_proactor_tpn_event_proactor (pn_event_t *event)
 Return the proactor associated with an event or NULL.
pn_listener_tpn_event_listener (pn_event_t *event)
 Return the listener associated with an event or NULL.

Detailed Description

Experimental - Multithreaded IO

The proactor associates a Connection with a Transport, either by making an outgoing connection or accepting an incoming one. It delivers events to application threads for handling.


The Proactor is thread-safe, but the protocol engine is not. The proactor ensures that each Connection and its associated values (Session, Link etc.) is handle sequentially, even if there are multiple application threads. See pn_proactor_wait().