WSGI:应用程序返回的可迭代对象是否可以从不同的线程进行迭代?
WSGI: Can the iterable returned from the app be iterated from different threads?
阅读 PEP 3333, it is not entirely clear to me if it guaranteed that the iterable returned from an application will be iterated on the same thread that run the application or even if all iteration steps are done on the same step (i.e. if the iterable has a thread affinity to the thread that returned it). I found some discussion on the web-sig mailing list from 2005 中的 WSGI 规范,其中说明了 "not guaranteed but it would be bad if some server did it that way" 的效果。
此外,在 section on middleware 中,PEP 说 "synchronous applications and servers can conspire to reduce the number of threads that are required to run a given number of application instances simultaneously" 这也意味着迭代可以从不同的线程完成。
所以我的主要问题是:是否有任何 WSGI 实现迭代从 WSGI 应用程序从不同线程返回的可迭代对象,尤其是。线程与调用应用程序的线程不同?
None 的更流行的 WSGI 服务器有,但从未听说过任何其他服务器也有。
阅读 PEP 3333, it is not entirely clear to me if it guaranteed that the iterable returned from an application will be iterated on the same thread that run the application or even if all iteration steps are done on the same step (i.e. if the iterable has a thread affinity to the thread that returned it). I found some discussion on the web-sig mailing list from 2005 中的 WSGI 规范,其中说明了 "not guaranteed but it would be bad if some server did it that way" 的效果。
此外,在 section on middleware 中,PEP 说 "synchronous applications and servers can conspire to reduce the number of threads that are required to run a given number of application instances simultaneously" 这也意味着迭代可以从不同的线程完成。
所以我的主要问题是:是否有任何 WSGI 实现迭代从 WSGI 应用程序从不同线程返回的可迭代对象,尤其是。线程与调用应用程序的线程不同?
None 的更流行的 WSGI 服务器有,但从未听说过任何其他服务器也有。