Filtering process to keep connection.

- Main process should be connected to all other processes.
- Controller should be connected to Router.
- Router should be connected to Controller and all Workers.
- Workers should be connected to Router worker thread ports only.

This filtering helps to avoid unnecessary communication and various errors
during massive application workers stop / restart.
This commit is contained in:
Max Romanov
2017-10-19 17:37:19 +03:00
parent 6031c63225
commit b3aab8c66f
5 changed files with 58 additions and 13 deletions

View File

@@ -70,6 +70,10 @@ typedef struct {
} nxt_process_t;
extern nxt_bool_t nxt_proc_conn_martix[NXT_PROCESS_MAX][NXT_PROCESS_MAX];
extern nxt_bool_t
nxt_proc_remove_notify_martix[NXT_PROCESS_MAX][NXT_PROCESS_MAX];
NXT_EXPORT nxt_pid_t nxt_process_create(nxt_task_t *task,
nxt_process_t *process);
NXT_EXPORT nxt_pid_t nxt_process_execute(nxt_task_t *task, char *name,
@@ -95,6 +99,8 @@ NXT_EXPORT void nxt_process_port_add(nxt_task_t *task, nxt_process_t *process,
#define nxt_process_port_loop \
nxt_queue_loop
nxt_process_type_t nxt_process_type(nxt_process_t *process);
void nxt_process_close_ports(nxt_task_t *task, nxt_process_t *process);
void nxt_process_connected_port_add(nxt_process_t *process, nxt_port_t *port);