noxdafox/pebble

@concurrent.process returned future blocks/hangs on running(), cancelled(), done() calls

bitsofinfo opened this issue · 2 comments

Hi- thanks for this library.

Trying to understand something. In my program I have a function such as


async def processor(something):
   # do some intensive work that calls more async code

@concurrent.process
def do(something):
    asyncio.run(processor(something))
   

def whatever():
    for x in somethings:
        f = do(x)
        print(f.running())

What I am noticing is that the call to f.running() just hangs.... shouldn't that immediately return true or false?

also its not just running, but all the others as well. I thought only result() would block

Mixing multiprocessing and asyncio requires a certain degree of knowledge on how the two fundamentally work.

I would recommend to first read the documentation in merit and understand what can and cannot be done when mixing asyncio and multiprocessing.

This issue has nothing to do with Pebble itself.

Please do not use GitHub issues for guidance. There are other places such as Stackoverflow for that.