dabeaz / thredo

Thredo was an experiment - It's dead. Feel free to look around.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

thredo/thredo/core.py has a mistake

guhongyeying opened this issue · comments

1 AttributeError: module 'curio.thread' has no attribute 'TAWAIT'

2 In the thredo/thredo/core.py:
AWAIT = curio.thread.TAWAIT:
It should be changed to AWAIT = curio.thread.AWAIT.

Thredo is experimental/research software. To be using it, you also need to be using the most up-to-date version of Curio, which in this case, means the version checked out of Github (not the one installed via PyPi). That version of Curio defines TAWAIT.

I am trying out thredo as well and I have a similar problem. I have curio checkout but running examples/ex1.py gives me error:

    async with curio.spawn_thread():
TypeError: spawn_thread() missing 1 required positional argument: 'func'

I guess curio has moved forward. Do you have commit id of curio known to be working with thredo? I see there has been some refactoring of curio happening in the meantime. Would dabeaz/curio@4a36eb7 be a good candidate? Tests pass but the examples show some kind of error at

_request_queue = queue.UniversalQueue()
(NameError: name 'queue' is not defined).

Let me take a look at the situation. Curio is, indeed, undergoing some major cleanup and refactoring. There is some chance that much of the "thredo" functionality will end up in the Curio repo at some point---but not just yet.