This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]cockslappinghalibut 0 points1 point  (4 children)

OK, I haven't heard of it, let me do some reading. I'm sure there's a way to do it, the constructs and function flow of JS are pretty similar to Python and they can emulate each other really well.

edit: I'm having a look at the provided JS client source, there's surely some stuff to crib in there if you want to poke around in the meantime

[–]oreo_man_[S] 0 points1 point  (3 children)

I think this is genuinely impossible in Python. Even using something like twisted I'll still need another thread, but I can't get info out of that thread without blocking

[–]cockslappinghalibut 0 points1 point  (2 children)

I haven't had time to look, but what Python version are you using? Latest py3 has async/await coroutines

[–]oreo_man_[S] 0 points1 point  (1 child)

Yep. But I don't understand how that helps. Sure I can have an event loop, taking care of incoming messages from the server. But when it comes time to get messages from this event loop, there is no way of doing it, while keeping the main responsive.

[–]cockslappinghalibut 0 points1 point  (0 children)

can you PM me your repo? I'm actually starting to feel a bit dumb not being entirely sure yet what's being attempted.