summaryrefslogtreecommitdiffhomepage
path: root/src/python/nxt_python_asgi.c (follow)
AgeCommit message (Collapse)AuthorFilesLines
2021-07-20Python: using default event_loop for main thread for ASGI.Max Romanov1-11/+17
Unit's ASGI implementation creates a new event loop to run an application for each thread since 542b5b8c0647. This may cause unexpected exceptions or strange bugs if asyncio synchronisation primitives are initialised before the application starts (e.g. globally). Although the approach with a new event loop for the main thread is consistent and helps to prepare the application to run in multiple threads, it can be a source of pain for people who just want to run single-threaded ASGI applications in Unit. This is related to #560 issue on GitHub.
2021-05-20Python: support for multiple targets.Oisin Canty1-17/+20
2020-12-29Libunit: processing single port message.Max Romanov1-13/+28
This partially reverts the optimisation introduced in 1d84b9e4b459 to avoid an unpredictable block in nxt_unit_process_port_msg(). Under high load, this function may never return control to its caller, and the external event loop (in Node.js and Python asyncio) won't be able to process other scheduled events. To reproduce the issue, two request processing types are needed: 'fast' and 'furious'. The 'fast' one simply returns a small response, while the 'furious' schedules asynchronous calls to external resources. Thus, if Unit is subjected to a large amount of 'fast' requests, the 'furious' request processing freezes until the high load ends. The issue was found by Wu Jian Ping (@wujjpp) during Node.js stream implementation discussion and relates to PR #502 on GitHub.
2020-11-18Libunit: closing active requests on quit.Max Romanov1-1/+14
2020-11-10Python: supporting ASGI legacy protocol.Max Romanov1-23/+98
Introducing manual protocol selection for 'universal' apps and frameworks.
2020-11-05Python: fixing some arguments reference counting.Max Romanov1-33/+130
2020-11-05Python: request processing in multiple threads.Max Romanov1-186/+304
This closes #459 issue on GitHub.
2020-10-01Python: ASGI server introduced.Max Romanov1-0/+1227
This closes #461 issue on GitHub.