swagger-py-codegen icon indicating copy to clipboard operation
swagger-py-codegen copied to clipboard

added --use-async option: generate async handlers (tornado)

Open ptytb opened this issue 5 years ago • 2 comments

ptytb avatar Jul 14 '19 16:07 ptytb

The modification could not be compatible with python 2.x, though python 2.x should not be supported anymore. Maybe we can publish a new major version to accept this pr? @Rejown @zrq495 @foodszhang

Weilor avatar Sep 10 '19 03:09 Weilor

For python prior to 3.5 (without the async keyword) it is possible to use @gen.coroutine decorator on handler methods and use yield instead of await to make them asynchronous.

So there could've been two mutually exclusive options like --use-async and --use-gen-coroutine.

ptytb avatar Sep 10 '19 10:09 ptytb