summaryrefslogtreecommitdiffhomepage
path: root/src/python/nxt_python.h
diff options
context:
space:
mode:
authorMax Romanov <max.romanov@nginx.com>2020-11-05 00:04:59 +0300
committerMax Romanov <max.romanov@nginx.com>2020-11-05 00:04:59 +0300
commit8dcb0b9987033d0349a6ecf528014a9daa574787 (patch)
tree34a79dc0f21f6b3c76378343cc94682f25c6b417 /src/python/nxt_python.h
parent4225361f0ea7d230c80209d76fbc67a932651380 (diff)
downloadunit-8dcb0b9987033d0349a6ecf528014a9daa574787.tar.gz
unit-8dcb0b9987033d0349a6ecf528014a9daa574787.tar.bz2
Python: request processing in multiple threads.
This closes #459 issue on GitHub.
Diffstat (limited to 'src/python/nxt_python.h')
-rw-r--r--src/python/nxt_python.h19
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_ */