nxt_unit.h (1713:f5ba5973a0a3) nxt_unit.h (1980:43553aa72111)
1
2/*
3 * Copyright (C) NGINX, Inc.
4 */
5
6#ifndef _NXT_UNIT_H_INCLUDED_
7#define _NXT_UNIT_H_INCLUDED_
8

--- 122 unchanged lines hidden (view full) ---

131
132 /* Connection closed. */
133 void (*close_handler)(nxt_unit_request_info_t *req);
134
135 /* Add new Unit port to communicate with process pid. Optional. */
136 int (*add_port)(nxt_unit_ctx_t *, nxt_unit_port_t *port);
137
138 /* Remove previously added port. Optional. */
1
2/*
3 * Copyright (C) NGINX, Inc.
4 */
5
6#ifndef _NXT_UNIT_H_INCLUDED_
7#define _NXT_UNIT_H_INCLUDED_
8

--- 122 unchanged lines hidden (view full) ---

131
132 /* Connection closed. */
133 void (*close_handler)(nxt_unit_request_info_t *req);
134
135 /* Add new Unit port to communicate with process pid. Optional. */
136 int (*add_port)(nxt_unit_ctx_t *, nxt_unit_port_t *port);
137
138 /* Remove previously added port. Optional. */
139 void (*remove_port)(nxt_unit_t *, nxt_unit_port_t *port);
139 void (*remove_port)(nxt_unit_t *, nxt_unit_ctx_t *,
140 nxt_unit_port_t *port);
140
141 /* Remove all data associated with process pid including ports. Optional. */
142 void (*remove_pid)(nxt_unit_t *, pid_t pid);
143
144 /* Gracefully quit the application. Optional. */
145 void (*quit)(nxt_unit_ctx_t *);
146
147 /* Shared memory release acknowledgement. Optional. */

--- 14 unchanged lines hidden (view full) ---

162
163struct nxt_unit_init_s {
164 void *data; /* Opaque pointer to user-defined data. */
165 void *ctx_data; /* Opaque pointer to user-defined data. */
166 int max_pending_requests;
167
168 uint32_t request_data_size;
169 uint32_t shm_limit;
141
142 /* Remove all data associated with process pid including ports. Optional. */
143 void (*remove_pid)(nxt_unit_t *, pid_t pid);
144
145 /* Gracefully quit the application. Optional. */
146 void (*quit)(nxt_unit_ctx_t *);
147
148 /* Shared memory release acknowledgement. Optional. */

--- 14 unchanged lines hidden (view full) ---

163
164struct nxt_unit_init_s {
165 void *data; /* Opaque pointer to user-defined data. */
166 void *ctx_data; /* Opaque pointer to user-defined data. */
167 int max_pending_requests;
168
169 uint32_t request_data_size;
170 uint32_t shm_limit;
171 uint32_t request_limit;
170
171 nxt_unit_callbacks_t callbacks;
172
173 nxt_unit_port_t ready_port;
174 uint32_t ready_stream;
175 nxt_unit_port_t router_port;
176 nxt_unit_port_t read_port;
177 int log_fd;

--- 32 unchanged lines hidden (view full) ---

210int nxt_unit_run(nxt_unit_ctx_t *);
211
212int nxt_unit_run_ctx(nxt_unit_ctx_t *ctx);
213
214int nxt_unit_run_shared(nxt_unit_ctx_t *ctx);
215
216nxt_unit_request_info_t *nxt_unit_dequeue_request(nxt_unit_ctx_t *ctx);
217
172
173 nxt_unit_callbacks_t callbacks;
174
175 nxt_unit_port_t ready_port;
176 uint32_t ready_stream;
177 nxt_unit_port_t router_port;
178 nxt_unit_port_t read_port;
179 int log_fd;

--- 32 unchanged lines hidden (view full) ---

212int nxt_unit_run(nxt_unit_ctx_t *);
213
214int nxt_unit_run_ctx(nxt_unit_ctx_t *ctx);
215
216int nxt_unit_run_shared(nxt_unit_ctx_t *ctx);
217
218nxt_unit_request_info_t *nxt_unit_dequeue_request(nxt_unit_ctx_t *ctx);
219
218int nxt_unit_is_main_ctx(nxt_unit_ctx_t *ctx);
219
220/*
221 * Receive and process one message, invoke configured callbacks.
222 *
223 * If application implements it's own event loop, each datagram received
224 * from port socket should be initially processed by unit. This function
225 * may invoke other application-defined callback for message processing.
226 */
227int nxt_unit_run_once(nxt_unit_ctx_t *ctx);

--- 171 unchanged lines hidden ---
220/*
221 * Receive and process one message, invoke configured callbacks.
222 *
223 * If application implements it's own event loop, each datagram received
224 * from port socket should be initially processed by unit. This function
225 * may invoke other application-defined callback for message processing.
226 */
227int nxt_unit_run_once(nxt_unit_ctx_t *ctx);

--- 171 unchanged lines hidden ---