Skip to content

Support async key retrieval #7

@jhamman

Description

@jhamman

We are currently using FastAPI as xpublish's web framework / api engine. FastAPI supports async out of the box (details here: https://fastapi.tiangolo.com/async/).

Some initial applications indicate that we're not getting the expected async behavior. I suspect this is somehow related to how we're using dask to fetch chunks of data. Here's what we have now:

GET chunk endpoint:

https://github.com/jhamman/xpublish/blob/044e9b7b07202f57302a9368b16c2db4cddaa79a/xpublish/rest.py#L140-L143

Which calls the get_key method:

https://github.com/jhamman/xpublish/blob/044e9b7b07202f57302a9368b16c2db4cddaa79a/xpublish/rest.py#L93-L105

Within get_data_chunk, we call compute() on individual chunks:

https://github.com/jhamman/xpublish/blob/044e9b7b07202f57302a9368b16c2db4cddaa79a/xpublish/rest.py#L254-L255

Is this the best way to do this? Do we need to modify how dask's scheduler see's these tasks or is configured to use async?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions