Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

asyncio support #265

Merged
merged 9 commits into from
Oct 26, 2020
Merged

asyncio support #265

merged 9 commits into from
Oct 26, 2020

Conversation

geospatial-jeff
Copy link
Member

@geospatial-jeff geospatial-jeff commented Sep 18, 2020

rio_tiler/io/base.py Outdated Show resolved Hide resolved
@@ -92,6 +83,95 @@ def point(self, lon: float, lat: float, **kwargs: Any) -> List:
...


@attr.s
class AsyncBaseReader(metaclass=abc.ABCMeta):
Copy link
Member Author

@geospatial-jeff geospatial-jeff Sep 26, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

abc doesn't enforce the signature of the method, just that the method is present, so we could reuse the base class but mypy is not happy because the response types are different.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So we just need to make sure that this base class maintains parity with the BaseReader?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, there might be a better way to enforce the same type across both classes besides duck typing but I can't think of one that would make mypy happy.

rio_tiler/io/base.py Outdated Show resolved Hide resolved
Copy link
Member

@vincentsarago vincentsarago left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@geospatial-jeff
Copy link
Member Author

I'd like to try this out in aiocogeo before we merge. Started that work in a branch (https://github.com/geospatial-jeff/aiocogeo/tree/rio-tiler) but there are a few things I need to add first to match rio-tiler like color interp and color table.

rio_tiler/io/base.py Outdated Show resolved Hide resolved
@geospatial-jeff geospatial-jeff changed the title [WIP] asyncio support asyncio support Oct 24, 2020
@@ -92,6 +83,95 @@ def point(self, lon: float, lat: float, **kwargs: Any) -> List:
...


@attr.s
class AsyncBaseReader(metaclass=abc.ABCMeta):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So we just need to make sure that this base class maintains parity with the BaseReader?

rio_tiler/io/base.py Outdated Show resolved Hide resolved
@vincentsarago vincentsarago merged commit 0e4a61f into master Oct 26, 2020
@vincentsarago vincentsarago deleted the async branch October 26, 2020 17:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add AsyncBaseReader, AsyncCogReader
3 participants