pythonswaggertornadocoroutineconnexion

Is it possible to use Async in connexion, the swagger codegen python server using tornado?


If I add @gen.coroutine to the method handling a request that was generated by connexion, it stops working. It will break the connection with the client and does not return anything.

How can I use connexion+tornado asynchronously? gen.sleep for example? If I yield gen.sleep in the request handler without @gen.coroutine, it does not wait for the specified time.


Solution

  • I found the answer. It's not pleasant though..

    https://waffle.io/zalando/connexion/cards/57c036758b96c67f0165fb9f

    @funseiki ... giving it more though we would need to actually do quite some changes in other parts of the Connexion code to support Tornado async. For now the answer is "not possible". :/