Skip to content

enable async calls #901

@jingyi-zhao-01

Description

@jingyi-zhao-01

Is your feature request related to a problem? Please describe.
https://polygon.io/docs/rest/options/snapshots/option-contract-snapshot

  • client.get_snapshot_option is sync,cannot leverage coroutine for multiple asynchrounus fetching.
  • it's very slow when fetching each one by one.

Describe the solution you'd like

  • Enable async call of this funtion version so people cacn leverage ccouroutine.
tasks = [
        client.get_contract_snapshot_async(underlying_asset, contract.ticker)
        for contract in contracts
    ]

    return await asyncio.gather(*tasks)

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions