New process port exchange changed. READY message type introduced.

Application process start request DATA message from router to master.
Master notifies router via NEW_PORT message after worker process become ready.
This commit is contained in:
Max Romanov
2017-07-12 20:32:16 +03:00
parent c38bcb7d70
commit b0c1e740cf
23 changed files with 1234 additions and 393 deletions

View File

@@ -89,15 +89,18 @@ static const nxt_event_conn_state_t nxt_controller_conn_close_state;
nxt_int_t
nxt_controller_start(nxt_task_t *task, nxt_runtime_t *rt)
nxt_controller_start(nxt_task_t *task, void *data)
{
nxt_mp_t *mp;
nxt_runtime_t *rt;
nxt_conf_value_t *conf;
nxt_http_fields_hash_t *hash;
static const nxt_str_t json
= nxt_string("{ \"listeners\": {}, \"applications\": {} }");
rt = task->thread->runtime;
hash = nxt_http_fields_hash_create(nxt_controller_request_fields,
rt->mem_pool);
if (nxt_slow_path(hash == NULL)) {
@@ -853,13 +856,7 @@ nxt_controller_conf_pass(nxt_task_t *task, nxt_conf_value_t *conf)
rt = task->thread->runtime;
nxt_runtime_port_each(rt, port) {
if (port->type == NXT_PROCESS_ROUTER) {
break;
}
} nxt_runtime_port_loop;
port = rt->port_by_type[NXT_PROCESS_ROUTER];
size = nxt_conf_json_length(conf, NULL);