diff options
author | Max Romanov <max.romanov@nginx.com> | 2020-11-05 00:04:59 +0300 |
---|---|---|
committer | Max Romanov <max.romanov@nginx.com> | 2020-11-05 00:04:59 +0300 |
commit | 8dcb0b9987033d0349a6ecf528014a9daa574787 (patch) | |
tree | 34a79dc0f21f6b3c76378343cc94682f25c6b417 /src/python/nxt_python.h | |
parent | 4225361f0ea7d230c80209d76fbc67a932651380 (diff) | |
download | unit-8dcb0b9987033d0349a6ecf528014a9daa574787.tar.gz unit-8dcb0b9987033d0349a6ecf528014a9daa574787.tar.bz2 |
Python: request processing in multiple threads.
This closes #459 issue on GitHub.
Diffstat (limited to '')
-rw-r--r-- | src/python/nxt_python.h | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/src/python/nxt_python.h b/src/python/nxt_python.h index 6d7eba8e..b581dd46 100644 --- a/src/python/nxt_python.h +++ b/src/python/nxt_python.h @@ -44,20 +44,25 @@ typedef struct { PyObject **object_p; } nxt_python_string_t; +typedef struct { + int (*ctx_data_alloc)(void **pdata); + void (*ctx_data_free)(void *data); + int (*startup)(void *data); + int (*run)(nxt_unit_ctx_t *ctx); + int (*ready)(nxt_unit_ctx_t *ctx); + void (*done)(void); +} nxt_python_proto_t; + -nxt_int_t nxt_python_init_strings(nxt_python_string_t *pstr); +int nxt_python_init_strings(nxt_python_string_t *pstr); void nxt_python_done_strings(nxt_python_string_t *pstr); void nxt_python_print_exception(void); -nxt_int_t nxt_python_wsgi_init(nxt_task_t *task, nxt_unit_init_t *init); -int nxt_python_wsgi_run(nxt_unit_ctx_t *ctx); -void nxt_python_wsgi_done(void); +int nxt_python_wsgi_init(nxt_unit_init_t *init, nxt_python_proto_t *proto); int nxt_python_asgi_check(PyObject *obj); -nxt_int_t nxt_python_asgi_init(nxt_task_t *task, nxt_unit_init_t *init); -nxt_int_t nxt_python_asgi_run(nxt_unit_ctx_t *ctx); -void nxt_python_asgi_done(void); +int nxt_python_asgi_init(nxt_unit_init_t *init, nxt_python_proto_t *proto); #endif /* _NXT_PYTHON_H_INCLUDED_ */ |