Re: [python-tulip] BitTorrent client with asyncio (Python 3.4.3)

2015-12-02 Thread Leslie Klein
Thank you! loop.create_task does exactly what I want. main uses another level of yield from (as you explained). That way I don't use loop.run_until_complete within main. Here is my top-level code that integrates server task and client tasks and runs them in one loop: # create client cl

Re: [python-tulip] BitTorrent client with asyncio (Python 3.4.3)

2015-12-01 Thread Guido van Rossum
Hi Leslie, This sounds like a cool project. I don't know how to answer #1 (maybe 0.0.0.0 would work?) but for #2, instead of using run_until_complete() you should probably use a combination of coroutines and tasks. Inside a coroutine, if you want to wait for another coroutine, use "yield from ot

[python-tulip] BitTorrent client with asyncio (Python 3.4.3)

2015-11-30 Thread Leslie Klein
I am writing a BitTorrent client using asyncio and the Streams API. I'm trying to work at the highest level possible. I have the download part working (client opens a connection to peers provided by tracker and downloads all pieces). Client can also upload pieces to connected peers, if requested