summaryrefslogtreecommitdiffhomepage
path: root/src/nxt_unit.h (follow)
AgeCommit message (Collapse)AuthorFilesLines
2021-11-24Sending shared port to application prototype.Max Romanov1-0/+2
Application process started with shared port (and queue) already configured. But still waits for PORT_ACK message from router to start request processing (so-called "ready state"). Waiting for router confirmation is necessary. Otherwise, the application may produce response and send it to router before the router have the information about the application process. This is a subject of further optimizations.
2021-11-09Introduced SCM_CREDENTIALS / SCM_CREDS in the socket control msgs.Tiago Natel de Moura1-1/+1
2021-10-28Moving request limit control to libunit.Max Romanov1-3/+3
Introducting application graceful stop. For now only used when application process reach request limit value. This closes #585 issue on GitHub.
2020-11-18Go: removing C proxy functions and re-using goroutines.Max Romanov1-0/+2
2020-11-18Libunit: improving logging consistency.Max Romanov1-0/+1
Debug logging depends on macros defined in nxt_auto_config.h.
2020-10-28Router: introducing the PORT_ACK message.Max Romanov1-0/+2
The PORT_ACK message is the router's response to the application's NEW_PORT message. After receiving PORT_ACK, the application is safe to process requests using this port. This message avoids a racing condition when the application starts processing a request from the shared queue and sends REQ_HEADERS_ACK. The REQ_HEADERS_ACK message contains the application port ID as reply_port, which the router uses to send request data. When the application creates a new port, it immediately sends it to the main router thread. Because the request is processed outside the main thread, a racing condition can occur between the receipt of the new port in the main thread and the receipt of REQ_HEADERS_ACK in the worker router thread where the same port is specified as reply_port.
2020-10-28Libunit: added a function to discern main and worker contexts.Max Romanov1-0/+2
2020-10-28Libunit: gracefully quitting a multicontext application.Max Romanov1-0/+2
2020-10-01Publishing libunit's malloc() and free() wrappers for apps.Max Romanov1-0/+4
2020-09-18Updated racially charged language in messages and comments.Artem Konev1-1/+1
2020-08-11Introducing application and port shared memory queues.Max Romanov1-0/+2
The goal is to minimize the number of syscalls needed to deliver a message.
2020-08-11Introducing the shared application port.Max Romanov1-0/+13
This is the port shared between all application processes which use it to pass requests for processing. Using it significantly simplifies the request processing code in the router. The drawback is 2 more file descriptors per each configured application and more complex libunit message wait/read code.
2020-08-11Changing router to application shared memory exchange protocol.Max Romanov1-10/+1
The application process needs to request the shared memory segment from the router instead of the latter pushing the segment before sending a request to the application. This is required to simplify the communication between the router and the application and to prepare the router for using the application shared port and then the queue.
2020-08-11Changing router to application port exchange protocol.Max Romanov1-0/+1
The application process needs to request the port from the router instead of the latter pushing the port before sending a request to the application. This is required to simplify the communication between the router and the application and to prepare the router to use the application shared port and then the queue.
2020-08-11Adding a reference counter to the libunit port structure.Max Romanov1-9/+4
The goal is to minimize the number of (pid, id) to port hash lookups which require a library mutex lock. The response port is found once per request, while the read port is initialized at startup.
2020-08-11Libunit refactoring: port management.Max Romanov1-40/+4
- Changed the port management callbacks to notifications, which e. g. avoids the need to call the libunit function - Added context and library instance reference counts for a safer resource release - Added the router main port initialization
2020-03-30Attributing libunit logging function for arguments validation.Max Romanov1-2/+21
2020-03-12Using disk file to store large request body.Max Romanov1-0/+1
This closes #386 on GitHub.
2020-03-12Introducing readline function in libunit.Max Romanov1-0/+3
Ruby and Java modules now use this function instead of own implementations.
2019-12-24Introducing port messages to notify about out of shared memory.Max Romanov1-0/+6
- OOSM (out of shared memory). Sent by application process to router when application reaches the limit of allocated shared memory and needs more. - SHM_ACK. Sent by router to application when the application's shared memory is released and the OOSM flag is enabled for the segment. This implements blocking mode (the library waits for SHM_ACK in case of out of shared memory condition and retries allocating the required memory amount) and non-blocking mode (the library notifies the application that it's out of shared memory and returns control to the application module that sets up the output queue and puts SHM_ACK in the main message loop).
2019-12-24Adding "limits/shm" configuration validation and parsing.Max Romanov1-0/+1
2019-08-20Introducing websocket support in router and libunit.Max Romanov1-1/+31
2019-02-22Improvement and unification of version processing in build scripts.Alexander Borisov1-1/+1
This also eliminates expressions that incompatible with BSD make, thus fixing installation of Node.js module on FreeBSD (broken by dace60fc4926).
2018-12-19libunit: added generation of version header file.Alexander Borisov1-0/+2
2018-10-31Node.js: added async request execution.Alexander Borisov1-0/+2
2018-08-06Unit application library.Max Romanov1-0/+355
Library now used in all language modules. Old 'nxt_app_*' code removed. See src/test/nxt_unit_app_test.c for usage sample.