guokr / swagger-py-codegen

a Python web framework generator supports Flask, Tornado, Falcon, Sanic
554 stars 154 forks source link

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

Open ptytb opened 5 years ago

Weilor commented 5 years ago

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

ptytb commented 5 years ago

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.