Description
I'm creating a auto-generated API client using the openapi-generator for python. This API has some asynchronous functions that returns lines of data: JSON asynchronously.
I would like to have a callback that get this data and process it on a separate thread but I don't know how to use the async=True option when the call is instantiated. As I show it return a Thread but I don't know how to set the callback for it.
openapi-generator version
➜ openapi-generator version
4.0.3
OpenAPI declaration file content or url
https://gitlab.com/snippets/1882068/raw
Note: this YAML is auto generated from a Doxygen documentation for RetroShare project using this
Command line used for generation
openapi-generator generate -i wrapper_openapi.yml -g python -o ../openapi-python-retroshare-api-wrapper
Steps to reproduce
You can generate the wrapper using the command above with the provided YAML or cloning this.
I tested this code:
thread = api_instance.rs_gxs_channels_turtle_search_request(async_req=True, req_rs_gxs_channels_turtle_search_request=req_rs_gxs_channels_turtle_search_request)
result = thread.get()
print("should be printed")
The program just stop, the "should be printed" string is never printed until the connection is closed by the server, so is not async, so is not a separated thread or I don't know how to use it.
In addition I would like that the responses received asynchronously be processed in a callback function
Related issues/PRs
I just opened an stackoverflow question:
https://stackoverflow.com/questions/57486784/python-openapi-generator-how-to-make-http-asyncrhonous-calls
Description
I'm creating a auto-generated API client using the openapi-generator for python. This API has some asynchronous functions that returns lines of
data: JSONasynchronously.I would like to have a callback that get this data and process it on a separate thread but I don't know how to use the
async=Trueoption when the call is instantiated. As I show it return aThreadbut I don't know how to set the callback for it.openapi-generator version
OpenAPI declaration file content or url
https://gitlab.com/snippets/1882068/raw
Note: this YAML is auto generated from a Doxygen documentation for RetroShare project using this
Command line used for generation
Steps to reproduce
You can generate the wrapper using the command above with the provided YAML or cloning this.
I tested this code:
The program just stop, the "should be printed" string is never printed until the connection is closed by the server, so is not async, so is not a separated thread or I don't know how to use it.
In addition I would like that the responses received asynchronously be processed in a callback function
Related issues/PRs
I just opened an stackoverflow question:
https://stackoverflow.com/questions/57486784/python-openapi-generator-how-to-make-http-asyncrhonous-calls