Forum Discussion

Joan's avatar
New Contributor
5 years ago

Create an async method that receive a callback function



I'm developing a yml openapi definition that will generate a client to interact with an already created API. This API has asynchronous functions that return "delayed" content, and the HTTP connection should be opened until a timeout, lets put the example that each two seconds return a json object that should be processed on the client.


So, I would like that the openapi generated client can get a callback function that the USER pass to the generated library, that process this "delayed" response in a separated thread or similar. Looking to the documentation I think that the callbacks are not defined for this purpose.


Is possible to do that with openapi?


Thanks in advance!



2 Replies

  • Joan's avatar
    New Contributor

    Oh i see, with the python generator it supports that each call to the endpoint could be called as async, and it returns a thread