1 #ifndef PROTON_REACTOR_H
2 #define PROTON_REACTOR_H 1
25 #include <proton/import_export.h>
26 #include <proton/type_compat.h>
29 #include <proton/selectable.h>
40 typedef struct pn_reactor_t pn_reactor_t;
41 typedef struct pn_acceptor_t pn_acceptor_t;
42 typedef struct pn_timer_t pn_timer_t;
43 typedef struct pn_task_t pn_task_t;
47 void (*finalize)(pn_handler_t *));
48 PNX_EXTERN
void pn_handler_free(pn_handler_t *handler);
49 PNX_EXTERN
void *pn_handler_mem(pn_handler_t *handler);
50 PNX_EXTERN
void pn_handler_add(pn_handler_t *handler, pn_handler_t *child);
51 PNX_EXTERN
void pn_handler_clear(pn_handler_t *handler);
54 PNX_EXTERN pn_reactor_t *pn_reactor(
void);
55 PNX_EXTERN pn_record_t *pn_reactor_attachments(pn_reactor_t *reactor);
56 PNX_EXTERN
pn_millis_t pn_reactor_get_timeout(pn_reactor_t *reactor);
57 PNX_EXTERN
void pn_reactor_set_timeout(pn_reactor_t *reactor,
pn_millis_t timeout);
60 PNX_EXTERN
void pn_reactor_yield(pn_reactor_t *reactor);
61 PNX_EXTERN
void pn_reactor_free(pn_reactor_t *reactor);
62 PNX_EXTERN
pn_collector_t *pn_reactor_collector(pn_reactor_t *reactor);
63 PNX_EXTERN pn_handler_t *pn_reactor_get_global_handler(pn_reactor_t *reactor);
64 PNX_EXTERN
void pn_reactor_set_global_handler(pn_reactor_t *reactor, pn_handler_t *handler);
65 PNX_EXTERN pn_handler_t *pn_reactor_get_handler(pn_reactor_t *reactor);
66 PNX_EXTERN
void pn_reactor_set_handler(pn_reactor_t *reactor, pn_handler_t *handler);
67 PNX_EXTERN pn_list_t *pn_reactor_children(pn_reactor_t *reactor);
68 PNX_EXTERN pn_selectable_t *pn_reactor_selectable(pn_reactor_t *reactor);
69 PNX_EXTERN
void pn_reactor_update(pn_reactor_t *reactor, pn_selectable_t *selectable);
70 PNX_EXTERN pn_acceptor_t *pn_reactor_acceptor(pn_reactor_t *reactor,
const char *host,
const char *port,
71 pn_handler_t *handler);
72 PNX_EXTERN
pn_error_t *pn_reactor_error(pn_reactor_t *reactor);
87 PNX_EXTERN
pn_connection_t *pn_reactor_connection_to_host(pn_reactor_t *reactor,
90 pn_handler_t *handler);
107 PNX_EXTERN
pn_connection_t *pn_reactor_connection(pn_reactor_t *reactor,
108 pn_handler_t *handler);
121 PNX_EXTERN
void pn_reactor_set_connection_host(pn_reactor_t *reactor,
144 PNX_EXTERN
const char *pn_reactor_get_connection_address(pn_reactor_t *reactor,
147 PNX_EXTERN
int pn_reactor_wakeup(pn_reactor_t *reactor);
148 PNX_EXTERN
void pn_reactor_start(pn_reactor_t *reactor);
149 PNX_EXTERN
bool pn_reactor_quiesced(pn_reactor_t *reactor);
150 PNX_EXTERN
bool pn_reactor_process(pn_reactor_t *reactor);
151 PNX_EXTERN
void pn_reactor_stop(pn_reactor_t *reactor);
152 PNX_EXTERN
void pn_reactor_run(pn_reactor_t *reactor);
153 PNX_EXTERN pn_task_t *pn_reactor_schedule(pn_reactor_t *reactor,
int delay, pn_handler_t *handler);
156 PNX_EXTERN
void pn_acceptor_set_ssl_domain(pn_acceptor_t *acceptor,
pn_ssl_domain_t *domain);
157 PNX_EXTERN
void pn_acceptor_close(pn_acceptor_t *acceptor);
158 PNX_EXTERN pn_acceptor_t *pn_connection_acceptor(
pn_connection_t *connection);
162 PNX_EXTERN
void pn_timer_tick(pn_timer_t *timer,
pn_timestamp_t now);
163 PNX_EXTERN pn_task_t *pn_timer_schedule(pn_timer_t *timer,
pn_timestamp_t deadline);
164 PNX_EXTERN
int pn_timer_tasks(pn_timer_t *timer);
166 PNX_EXTERN pn_record_t *pn_task_attachments(pn_task_t *task);
167 PNX_EXTERN
void pn_task_cancel(pn_task_t *task);
169 PNX_EXTERN pn_reactor_t *pn_class_reactor(
const pn_class_t *clazz,
void *
object);
170 PNX_EXTERN pn_reactor_t *pn_object_reactor(
void *
object);
171 PNX_EXTERN pn_reactor_t *pn_event_reactor(
pn_event_t *event);
173 PNX_EXTERN pn_handler_t *pn_record_get_handler(pn_record_t *record);
174 PNX_EXTERN
void pn_record_set_handler(pn_record_t *record, pn_handler_t *handler);
179 PNX_EXTERN pn_handler_t *pn_event_root(
pn_event_t *event);
Protocol and transport events.
int64_t pn_timestamp_t
A 64-bit timestamp in milliseconds since the Unix epoch.
Definition: types.h:170
uint32_t pn_millis_t
A span of time in milliseconds.
Definition: types.h:149
struct pn_connection_t pn_connection_t
An AMQP Connection object.
Definition: types.h:285
struct pn_error_t pn_error_t
An int error code and some string text to describe the error.
Definition: error.h:44
pn_event_type_t
An event type.
Definition: event.h:80
struct pn_event_t pn_event_t
Notification of a state change in the protocol engine.
Definition: event.h:75
struct pn_collector_t pn_collector_t
An event collector.
Definition: types.h:417
struct pn_ssl_domain_t pn_ssl_domain_t
API for using SSL with the Transport Layer.
Definition: ssl.h:80
SSL secure transport layer.