summaryrefslogtreecommitdiffhomepage
path: root/src/nxt_unit.h
diff options
context:
space:
mode:
authorMax Romanov <max.romanov@nginx.com>2020-08-11 19:20:15 +0300
committerMax Romanov <max.romanov@nginx.com>2020-08-11 19:20:15 +0300
commit83595606121a821f9e3cef0f0b7e7fe87eb1e50a (patch)
tree2374867dd2f69654a71e95b7abec3fdad13ffd1a /src/nxt_unit.h
parent6e31d6cd39be9d3f4ee680fc13c3fe42f5cd39e7 (diff)
downloadunit-83595606121a821f9e3cef0f0b7e7fe87eb1e50a.tar.gz
unit-83595606121a821f9e3cef0f0b7e7fe87eb1e50a.tar.bz2
Introducing the shared application port.
This is the port shared between all application processes which use it to pass requests for processing. Using it significantly simplifies the request processing code in the router. The drawback is 2 more file descriptors per each configured application and more complex libunit message wait/read code.
Diffstat (limited to 'src/nxt_unit.h')
-rw-r--r--src/nxt_unit.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/nxt_unit.h b/src/nxt_unit.h
index 79157f5f..0f16773f 100644
--- a/src/nxt_unit.h
+++ b/src/nxt_unit.h
@@ -202,8 +202,21 @@ nxt_unit_ctx_t *nxt_unit_init(nxt_unit_init_t *);
*/
int nxt_unit_run(nxt_unit_ctx_t *);
+int nxt_unit_run_ctx(nxt_unit_ctx_t *ctx);
+
+int nxt_unit_run_shared(nxt_unit_ctx_t *ctx);
+
+/*
+ * Receive and process one message, invoke configured callbacks.
+ *
+ * If application implements it's own event loop, each datagram received
+ * from port socket should be initially processed by unit. This function
+ * may invoke other application-defined callback for message processing.
+ */
int nxt_unit_run_once(nxt_unit_ctx_t *ctx);
+int nxt_unit_process_port_msg(nxt_unit_ctx_t *ctx, nxt_unit_port_t *port);
+
/* Destroy application library object. */
void nxt_unit_done(nxt_unit_ctx_t *);