santiment / sanpy

Santiment API Python Client
MIT License
94 stars 29 forks source link

Feature/httpx #83

Closed blockchainunchained closed 6 months ago

blockchainunchained commented 5 years ago

Add httpx and then use it to support async clients.

IvanIvanoff commented 4 years ago
image

I think we should proceed with moving this to production once httpx is stable

blockchainunchained commented 4 years ago

Agreed, I'm using this branch to power the ticker at /r/ethfinance and it's stable for my use but I'm not doing anything crazy or weird.

valo commented 4 years ago

@blockchainunchained is there any change on the public API with this case? If not, what are the benefits from this change? If yes, should we add some more info in the README?

@spiderjako can you, please, take a look at this PR and see if you have some comments?

blockchainunchained commented 4 years ago

No changes to the public API, this simply uses HTTPX (who will be releasing 1.0 shortly, API should already be stable) instead of Requests. HTTPX is designed to be a drop in replacement for requests but allows asynchronous projects to not block their main thread when trying to interact with SanBase via SanPy.

I've not pulled the latest HTTPX or the latest SanPy recently so don't merge this until I've had a chance to test it (and also we should wait until HTTPX goes 1.0).

No documentation updates are required because if an event loop is not detected one is created internally so it doesn't matter whether you are running synchronous Python code or asynchronous Python code, or at least that is my understanding of it anyway.

I'm fairly busy with other stuff right now but I will update when HTTPX release 1.0

kalkov commented 4 years ago

@blockchainunchained, @valo
Maybe would be best to close the PR now and re-open when HTTPX release 1.0?

blockchainunchained commented 4 years ago

I've been keeping this up to date with the latest HTTPX and I'm more than happy to continue doing so until the final version of HTTPX is released. Other than artificially lowering the pull request count what is the advantage to closing this pull request prematurely?

IvanIvanoff commented 4 years ago

You can just put a WIP label on it and leave it open

blockchainunchained commented 4 years ago

It doesn't look like labels are set up.

Do you mean edit the title? If so should it prefix or postfix the existing title?

IvanIvanoff commented 4 years ago

I've created this label

IvanIvanoff commented 6 months ago

httpx still has no 1.0 version ~5 years later.

Over the years since this PR was opened we've did some work in the async direction:

After some discussion internally, we decided that we don't want to replace the internals as done in this PR. One of our experienced Python developers has the following concerns:

If we still find the need to do something similar to the PR, we'll do it as an alternative implementation to the existing one, and users of the library can choose what to do.