You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, thank for this lib, its amazing.
I want to create wrapper for this lib to my custom sdk, but I noticed that innertube does not have an asynchronous interface.
I have researched the code, and I see that httpx supports async interface with AsyncClient. After small modification (which not affect main codebase) i wrote async interface with usage AsyncClient which allows to work in async.
task 0 start sleep s 5
task 1 start sleep s 5
task 2 start sleep s 5
task 3 start sleep s 5
task 4 start sleep s 5
task 5 start sleep s 5
task 6 start sleep s 5
task 7 start sleep s 5
task 8 start sleep s 5
task 9 start sleep s 5
task 0 end
task 2 end
task 6 end
task 9 end
task 8 end
task 5 end
task 7 end
task 4 end
task 1 end
task 3 end
8.483278036117554
Here we see that event loop is blocked on every request, because every request is synchronous.
task 0 start sleep s 5
task 1 start sleep s 5
task 2 start sleep s 5
task 3 start sleep s 5
task 4 start sleep s 5
task 5 start sleep s 5
task 6 start sleep s 5
task 7 start sleep s 5
task 8 start sleep s 5
task 9 start sleep s 5
task 2 end
task 5 end
task 1 end
task 9 end
task 0 end
task 4 end
task 7 end
task 3 end
task 6 end
task 8 end
5.66729998588562
So, what do you think about it? If you intresting, i can create PR with include async interface.
The text was updated successfully, but these errors were encountered:
Hi @dmozh, thanks for opening this issue and thanks for your kind words! Supporting asynchronous requests is absolutely something this library should support, especially given that httpx supports this. It wasn't implemented from the start mostly due to a lack of knowledge of asynchronous Python on my end in all honesty.
I'd definitely be interested in a PR if you're able to spare the time, and will add async support to my roadmap for innertube!
tombulled
changed the title
Asyncio client for innertube
🧵 Async Client for InnerTube
Feb 25, 2024
Awesome! To contribute your changes, you should be able to fork this repository, cut a branch on your fork with your changes, then open a PR from that branch into this repository.
GitHub has a guide on this here and DigitalOcean has a good write-up on this process too here. Hope that helps! 🙂
dmozh
added a commit
to dmozh/innertube
that referenced
this issue
May 12, 2024
Hi, thank for this lib, its amazing.
I want to create wrapper for this lib to my custom sdk, but I noticed that innertube does not have an asynchronous interface.
I have researched the code, and I see that httpx supports async interface with AsyncClient. After small modification (which not affect main codebase) i wrote async interface with usage AsyncClient which allows to work in async.
For example:
This sync client in async usage
and result
Here we see that event loop is blocked on every request, because every request is synchronous.
And example with async client
and result
So, what do you think about it? If you intresting, i can create PR with include async interface.
The text was updated successfully, but these errors were encountered: