plaid/plaid-python

Are there any plans to add asynchronous code support?

Werded opened this issue · 3 comments

Are there any plans to add asynchronous code support?

@Werded not currently -- but do you have any more info about your use case that might help us understand more about reasons to add them or help us think of alternatives we could recommend to work around the situation? In general Plaid API calls that do long-running/async processing use webhooks.

I want to have a possibility to use native python async/await syntax.If I use current version of library in async code it will block event loop.
e.g

import plaid
from plaid.model.asset_report_get_request import AssetReportGetRequest

async def some_func(asset_report_token):
    # blocking operation
    request = AssetReportGetRequest(
        asset_report_token=asset_report_token,
    )
    return client.asset_report_get(request)

Thanks for the details!

I checked with the team and apparently the issue is that we use urllib3 for the libraries, and urllib3 does not support async. With the template and config files in this repo combined with https://github.com/plaid/plaid-openapi you should be able to generate your own version of the clibs with OpenAPIGenerator using an async-supporting library like tornado or asyncio instead of urllib3 -- I haven't done this specific process myself but if you run into problems along the way there are folks here who can answer questions about it.