Commit Graph

33 Commits

Author SHA1 Message Date
Max Romanov
b150f07e80 Added basic port error handler. 2017-08-02 13:36:29 +03:00
Max Romanov
f23f985899 Runtime processes protected with mutex. 2017-08-02 13:22:07 +03:00
Max Romanov
9367dd2bf8 Implicit port read buffer completion.
To disable implicit completion, handler should reset msg->buf field.
2017-08-02 13:21:32 +03:00
Max Romanov
82c0304ab8 Using port rpc in router->master start worker request. 2017-08-02 13:20:53 +03:00
Max Romanov
f2e9afdf42 Port RPC interface introduced.
Usage:
1. Register handlers in incoming port with nxt_port_rpc_register_handler().
2. Use return value as a stream identifier for next nxt_port_socket_write().
2017-08-02 13:14:31 +03:00
Igor Sysoev
68d35e9157 Fixed a bug introduced in the changeset 9585902ff351. 2017-07-19 23:11:55 +03:00
Igor Sysoev
ba6c8e51be The master process title has been renamed to "main" process.
The command line is enclosed in brackets.
2017-07-19 15:22:40 +03:00
Igor Sysoev
0d7af2adf7 Removed "process" word from process title. 2017-07-19 10:49:46 +03:00
Igor Sysoev
21de5c1d18 Added application name in process title. 2017-07-18 22:27:13 +03:00
Max Romanov
803855138c Mem pool cleanup introduced.
Used for connection mem pool cleanup, which can be used by buffers.
Used for port mem pool to safely destroy linked process.
2017-07-18 00:21:16 +03:00
Max Romanov
eb675f2d78 Port allocation and destroy changed. Worker process stop introduced. 2017-07-18 00:21:14 +03:00
Valentin Bartenev
d669045b75 Fixed the previous commit. 2017-07-14 17:03:01 +03:00
Valentin Bartenev
a937047cb8 Null-terminated user and group. 2017-07-14 16:08:21 +03:00
Max Romanov
b0c1e740cf 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.
2017-07-12 20:32:16 +03:00
Valentin Bartenev
c38bcb7d70 Controller: proper reconfiguration requests handling.
Now controller serializes all reconfiguration requests
and waits for result from router.
2017-07-12 20:21:17 +03:00
Max Romanov
74cda90e31 Process stop notification from master to all other processes.
New port message type introduced NXT_PORT_MSG_REMOVE_PID. Default handler
removes process description from nxt_runtime_t with all ports, incoming and
outgoing mmaps etc.
2017-07-07 16:01:34 +03:00
Max Romanov
c56d2af3bc Router: read configuration from port.
Controller: stub to send configuration from POST body "as is" to router.
2017-07-06 18:38:51 +03:00
Max Romanov
e7a0634a71 Application-side message processing.
Usage on the router side:

    nxt_app_wmsg_t       wmsg;
    nxt_app_parse_ctx_t  parse_ctx;

    nxt_app_http_req_init(task, &parse_ctx);

    /* parse incoming request data */
    if (nxt_app_http_req_parse(task, &parse_ctx, buf) == NXT_DONE) {

        /* choose app */
        nxt_app = nxt_select_app(... &parse_ctx.r ...);

        /* find port */
        wmsg.port = nxt_get_app_port(... nxt_app ...);
        wmsg.buf = &wmsg.write;

        /* fill write message buffer in shared mem */
        nxt_app->prepare_msg(task, &parse_ctx.r, &wmsg);

        /* send message to app for processing */
        nxt_port_socket_write(task, wmsg.port, NXT_PORT_MSG_DATA,
                              -1, 0, 0, wmsg.write);
    }
2017-06-23 19:20:08 +03:00
Max Romanov
ac43bfcc72 nxt_process_create() changed to add process to runtime before callbacks. 2017-06-23 19:19:41 +03:00
Igor Sysoev
f888a5310c Using new memory pool implementation. 2017-06-20 19:49:17 +03:00
Max Romanov
f7b4bdfd89 Using shared memory to send data via nxt_port.
Usage:
    b = nxt_port_mmap_get_buf(task, port, size);
    b->mem.free = nxt_cpymem(b->mem.free, data, size);
    nxt_port_socket_write(task, port, NXT_PORT_MSG_DATA, -1, 0, b);
2017-05-12 20:32:41 +03:00
Igor Sysoev
3a8a4744b8 Fixed building on FreeBSD. 2017-03-14 19:03:49 +03:00
Igor Sysoev
6f2c9acd18 Processes refactoring.
The cycle has been renamed to the runtime.
2017-03-09 18:03:27 +03:00
Igor Sysoev
b379dae85e Port changes. 2017-02-22 15:10:28 +03:00
Igor Sysoev
029942f4eb I/O operations refactoring. 2017-02-22 15:09:59 +03:00
Igor Sysoev
059a864289 Event engines refactoring. 2017-02-07 20:04:56 +03:00
Igor Sysoev
e57b95a923 Process channels have been renamed to ports. 2017-02-01 20:03:45 +03:00
Igor Sysoev
8942550b13 More refactoring relicts removed. 2017-02-01 15:07:23 +03:00
Igor Sysoev
18281ee37e Event engine timers refactoring. 2017-01-31 22:26:50 +03:00
Igor Sysoev
bb87fa11ca nxt_event_timer has been renamed to nxt_timer. 2017-01-30 16:47:50 +03:00
Igor Sysoev
ba0391577b Work queues refactoring. 2017-01-27 11:35:11 +03:00
Igor Sysoev
de532922d9 Introducing tasks. 2017-01-23 19:56:03 +03:00
Igor Sysoev
16cbf3c076 Initial version. 2017-01-17 20:00:00 +03:00