0

I have Python REST client generated by Swagger codegen. How to send async requests and handle exceptions in non-blocking way? I came up to something like this but it does not differ from synchronous approach since thread.get() is blocking:

thread = some_api.some_method(body, async_req=True)
try
  thread.get()
except Exception as e:
  logger.error(str(e))

I would expect callback method parameter for handling exceptions but there is no any in generated client. I checked latest Swagger 2 and 3 so OpenAPI with default library (urllib3) but no callbacks present.

user3848246
  • 127
  • 1
  • 5

0 Answers0