summaryrefslogtreecommitdiffhomepage
path: root/src/nxt_port.h
diff options
context:
space:
mode:
authorMax Romanov <max.romanov@nginx.com>2017-08-02 13:14:31 +0300
committerMax Romanov <max.romanov@nginx.com>2017-08-02 13:14:31 +0300
commitf2e9afdf422c1771d3029416c6284a46c4039781 (patch)
treef468d92f7055f53482abab254fd521aecafa6ec3 /src/nxt_port.h
parent3812ffd336414904affc43d29229b04a2d6d8ae6 (diff)
downloadunit-f2e9afdf422c1771d3029416c6284a46c4039781.tar.gz
unit-f2e9afdf422c1771d3029416c6284a46c4039781.tar.bz2
Port RPC interface introduced.
Usage: 1. Register handlers in incoming port with nxt_port_rpc_register_handler(). 2. Use return value as a stream identifier for next nxt_port_socket_write().
Diffstat (limited to 'src/nxt_port.h')
-rw-r--r--src/nxt_port.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/nxt_port.h b/src/nxt_port.h
index 27c00132..1cbaaef1 100644
--- a/src/nxt_port.h
+++ b/src/nxt_port.h
@@ -21,6 +21,8 @@ typedef enum {
_NXT_PORT_MSG_DATA,
_NXT_PORT_MSG_REMOVE_PID,
_NXT_PORT_MSG_READY,
+ _NXT_PORT_MSG_RPC_READY,
+ _NXT_PORT_MSG_RPC_ERROR,
NXT_PORT_MSG_MAX,
@@ -33,6 +35,9 @@ typedef enum {
NXT_PORT_MSG_DATA_LAST = _NXT_PORT_MSG_DATA | NXT_PORT_MSG_LAST,
NXT_PORT_MSG_REMOVE_PID = _NXT_PORT_MSG_REMOVE_PID | NXT_PORT_MSG_LAST,
NXT_PORT_MSG_READY = _NXT_PORT_MSG_READY | NXT_PORT_MSG_LAST,
+ NXT_PORT_MSG_RPC_READY = _NXT_PORT_MSG_RPC_READY,
+ NXT_PORT_MSG_RPC_READY_LAST = _NXT_PORT_MSG_RPC_READY | NXT_PORT_MSG_LAST,
+ NXT_PORT_MSG_RPC_ERROR = _NXT_PORT_MSG_RPC_ERROR | NXT_PORT_MSG_LAST,
} nxt_port_msg_type_t;
@@ -104,6 +109,10 @@ struct nxt_port_s {
nxt_port_id_t id;
nxt_pid_t pid;
+ nxt_lvlhsh_t rpc_streams; /* stream to nxt_port_rpc_reg_t */
+ nxt_lvlhsh_t rpc_peers; /* peer to queue of nxt_port_rpc_reg_t */
+ uint32_t next_stream;
+
nxt_process_type_t type;
nxt_work_t work;
};