ASYNC sockets in Python
HTML-код
- Опубликовано: 13 сен 2024
- No, not the kind you put on a wall.
-
If you enjoy my content, consider supporting me on Patreon (or hit the JOIN button below to become a member)!
patreon.carber...
If you need help with anything, feel free to join the Discord server:
discord.carber...
I get a lot of people asking, so here's my Visual Studio Code setup!
• My Visual Studio Code ...
-
If you have any questions, don't hesitate to ask in the comments! I'll try and answer as soon as I can, providing someone else hasn't already done so.
#python #coding #howto
I've been looking for something like this for a while as the socket lib is synchronous. Thanks for this
the almighty blue router agrees, i agree
Great tutorial, short and to the point and got me on the right track!
Thank you, I'm glad you enjoyed it!
Thanks!!!
Interesting 🤔 it's gonna help allot
Yeah it's super useful honestly.
Thanks for the clear video. Is there any advantage of this over sockets with blocking? Or only in less trivial cases?
Probably only when you're already using async across the rest of the program. Otherwise you can get away with non-blocking sockets.
So cool.:) So as u're a master in clear things up, would you be able to make a video which show's a ASYNC socket communication between a Python Socket Server and a Arduino (maybe ESP32) Socket client who can handle events like--> Input in Python "ON" and on ESP32 led goes on ? :) looking since week for an option to solve the problem without using pyserial. :)
I don't own an Arduino, nor really know anything about them unfortunately! If you manage to find something with sockets, you can convert that to async with the help of this video.
What would be the underlying network protocol here? I've heard TCP is being used and UDP being not supported. Is there any proper way to use UDP in this scenario?
make a video on asyncio simple chat
Amazing video! But I think you forgot to add my name in your outro. 😂
Wait I got another member?! Thanks RUclips for letting me know... Apologies for that, I'll make it goes in the next video lmao. I now know RUclips doesn't bother to tell me when I get new members so I need to check.
Thanks for becoming a member though, really appreciate it!!
would be better if you have time to explain asyncio.queue as well.
Doesn't work for python 3.10 because you use while data!=b'quit':. It need delete it. Code already in cycle
Thanks a lot!!!!!!!!!!!!!!!!!!!!!
Lol... i just wrote an async websocket for remoot control my music bot using the "websockets" lib and now this tut one week later😅
ok
Impeccable timing from me as usual 😉 I was considering the websockets library, but when I tried it it was super jank.
why you don't use run function?
My real-world use case for this required it, so I guess I just went with it here. This example would work perfectly fine with the run method though, if you would prefer to use it.
@@Carberra so, I found in asyncio documentation today (after your video), that they recommend use high level api (run) for applications and low level for libraries (loop).
Huh, interesting. Good to know!
classic rookie mistake of treating a stream as if it understands the boundaries of your messages. I always laugh when I see this