Is it ok to spawn threads in a wsgi-application?

后端 未结 2 1315
栀梦
栀梦 2021-02-04 07:25

To achieve something similar to google app engines \'deferred calls\' (i.e., the request is handled, and afterwards the deferred task is handled), i experimented a little and ca

2条回答
  •  情书的邮戳
    2021-02-04 08:12

    WSGI does not specify the lifetime of an application process (as WSGI application is a Python callable object). You can run it in a way that is completely independent of the web server, in which case, only you control the lifetime.

    There is also nothing in the WSGI that would prohibit you from spawning threads, or processes, or doing whatever the hell you want.

提交回复
热议问题