diff options
author | Max Romanov <max.romanov@nginx.com> | 2020-09-14 13:27:02 +0300 |
---|---|---|
committer | Max Romanov <max.romanov@nginx.com> | 2020-09-14 13:27:02 +0300 |
commit | d94dac091f6a6878f10cfc8fa1ef059dd6bfe964 (patch) | |
tree | d8ca43e887834a58329895d65b3081347924fca9 /src/python/nxt_python.h | |
parent | d483aa74e61af411e40e98153a597d5a0473e2f1 (diff) | |
download | unit-d94dac091f6a6878f10cfc8fa1ef059dd6bfe964.tar.gz unit-d94dac091f6a6878f10cfc8fa1ef059dd6bfe964.tar.bz2 |
Python: split module initialization from WSGI implementation.
This is required for futher ASGI implementation.
Diffstat (limited to 'src/python/nxt_python.h')
-rw-r--r-- | src/python/nxt_python.h | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/src/python/nxt_python.h b/src/python/nxt_python.h new file mode 100644 index 00000000..417df7fd --- /dev/null +++ b/src/python/nxt_python.h @@ -0,0 +1,31 @@ + +/* + * Copyright (C) NGINX, Inc. + */ + +#ifndef _NXT_PYTHON_H_INCLUDED_ +#define _NXT_PYTHON_H_INCLUDED_ + + +#include <Python.h> +#include <nxt_unit.h> + + +extern PyObject *nxt_py_application; + +typedef struct { + nxt_str_t string; + PyObject **object_p; +} nxt_python_string_t; + +nxt_int_t 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); + + +#endif /* _NXT_PYTHON_H_INCLUDED_ */ |