diff options
author | Max Romanov <max.romanov@nginx.com> | 2017-07-12 20:32:18 +0300 |
---|---|---|
committer | Max Romanov <max.romanov@nginx.com> | 2017-07-12 20:32:18 +0300 |
commit | a97a5e8a0b7a921905994bae101d4f74f5a8aaa4 (patch) | |
tree | 922a2e6fed3630439b56d99b57c7452ee259f617 /src/nginext/nxt_go_lib.c | |
parent | 51bbdd33382eee7da34ff0ed7d0df51ab2345786 (diff) | |
download | unit-a97a5e8a0b7a921905994bae101d4f74f5a8aaa4.tar.gz unit-a97a5e8a0b7a921905994bae101d4f74f5a8aaa4.tar.bz2 |
Go: worker initialization. READY message to master.
Diffstat (limited to 'src/nginext/nxt_go_lib.c')
-rw-r--r-- | src/nginext/nxt_go_lib.c | 35 |
1 files changed, 24 insertions, 11 deletions
diff --git a/src/nginext/nxt_go_lib.c b/src/nginext/nxt_go_lib.c index 86d5b619..57c3da8e 100644 --- a/src/nginext/nxt_go_lib.c +++ b/src/nginext/nxt_go_lib.c @@ -42,7 +42,7 @@ nxt_go_request_done(nxt_go_request_t r) } void -nxt_go_listen_and_serve() +nxt_go_ready() { } @@ -54,16 +54,6 @@ nxt_go_process_port_msg(void *buf, size_t buf_len, void *oob, size_t oob_len) #else -#if 0 - -#include <nxt_runtime.h> -#include <nxt_master_process.h> -#include <nxt_application.h> - -#include "nxt_go_port.h" - -#endif - #include "nxt_go_run_ctx.h" #include "nxt_go_log.h" #include "nxt_go_port.h" @@ -184,6 +174,29 @@ nxt_go_request_done(nxt_go_request_t r) } +void +nxt_go_ready() +{ + char *go_stream; + nxt_port_msg_t port_msg; + + go_stream = getenv("NXT_GO_STREAM"); + + if (go_stream == NULL) { + return; + } + + port_msg.stream = atol(go_stream); + port_msg.pid = getpid(); + port_msg.reply_port = 0; + port_msg.type = NXT_PORT_MSG_READY; + port_msg.last = 0; + port_msg.mmap = 0; + + nxt_go_master_send(&port_msg, sizeof(port_msg), NULL, 0); +} + + nxt_go_request_t nxt_go_process_port_msg(void *buf, size_t buf_len, void *oob, size_t oob_len) { |