pyCraft icon indicating copy to clipboard operation
pyCraft copied to clipboard

Async?

Open zacholade opened this issue 7 years ago • 6 comments

Hello.

Just wondering if there are any plans to make this library asynchronous. If not, what is the benefit of making it synchronous and what would need doing to convert it? Especially after reading this: https://github.com/ammaraskar/pyCraft/issues/70 which makes it sound like the client can't keep up reading the amount of packets being sent from server.

Thanks.

zacholade avatar Jun 12 '18 17:06 zacholade

Not extremely hard, most of the networking bits are well abstracted away from parsing and responding to packets. Most of the work will revolve around making readPacket asynchronous: https://github.com/ammaraskar/pyCraft/blob/master/minecraft/networking/connection.py#L527-L568 and then converting over the existing NetworkingThread to be an asynchronous API: https://github.com/ammaraskar/pyCraft/blob/master/minecraft/networking/connection.py#L442

Now that python has async and await, I'll attempt an experimental branch with asynchronous IO.

ammaraskar avatar Jun 12 '18 18:06 ammaraskar

async await will definitely make this easier! An asynchronous branch would be greatly appreciated here. Thanks!

zacholade avatar Jun 12 '18 18:06 zacholade

Any updates on this? Is there an async branch? I certainly couldn't find it if there is.

Mikarific avatar Jan 21 '19 07:01 Mikarific

Any updates?

Lucky4Luuk avatar Sep 18 '19 13:09 Lucky4Luuk

Any updates, further developments? Would it help if we were to possibly make a pr with some attempts ourselves or anything to help out

Skelmis avatar Feb 07 '20 03:02 Skelmis

Hello, pyCraft is still on Python 2.x. But you can use it on 3.x

zty012 avatar May 13 '23 07:05 zty012