proton
0
|
Experimental The Connection Engine API wraps up the proton engine objects associated with a single connection: pn_connection_t, pn_transport_t and pn_collector_t. More...
#include <proton/condition.h>
#include <proton/event.h>
#include <proton/import_export.h>
#include <proton/types.h>
Go to the source code of this file.
Data Structures | |
struct | pn_buf_t |
A modifiable memory buffer. More... | |
struct | pn_cbuf_t |
A read-only memory buffer. More... | |
struct | pn_connection_engine_t |
A connection engine is a trio of pn_connection_t, pn_transport_t and pn_collector_t. More... | |
Typedefs | |
typedef struct pn_buf_t | pn_buf_t |
A modifiable memory buffer. More... | |
typedef struct pn_cbuf_t | pn_cbuf_t |
A read-only memory buffer. More... | |
typedef struct pn_connection_engine_t | pn_connection_engine_t |
A connection engine is a trio of pn_connection_t, pn_transport_t and pn_collector_t. More... | |
Experimental The Connection Engine API wraps up the proton engine objects associated with a single connection: pn_connection_t, pn_transport_t and pn_collector_t.
It provides a simple bytes-in/bytes-out interface for IO and generates pn_event_t events to be handled by the application.
The connection engine can be fed with raw AMQP bytes from any source, and it generates AMQP byte output to be written to any destination. You can use the engine to integrate proton AMQP with any IO library, or native IO on any platform.
The engine is not thread safe but each engine is independent. Separate engines can be used concurrently. For example a multi-threaded application can process connections in multiple threads, but serialize work for each connection to the corresponding engine.
The engine is designed to be thread and IO neutral so it can be integrated with single or multi-threaded code in reactive or proactive IO frameworks.
Summary of use:
Note on error handling: most of the pn_connection_engine_*() functions do not return an error code. If a fatal error occurs, the transport error condition will be set and the next call to pn_connection_engine_dispatch() report it to the handler as a PN_TRANSPORT_ERROR event and return false.