You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was hoping that someone might be able to help me out with a stumbling block that I have hit recently... We are trying to add support for the getter functions in itkwidgets, but trying to await the response results in a <FuturePromise Pending> that never resolves and a notebook cell that never exits. It seems that basically any ImJoy api call or plugin api call that needs to be awaited has this issue (can be reproduced in a notebook with the simple example below). I am wondering if I am missing or misunderstanding something or if this is maybe a bug. Thanks!
from imjoy_rpc import api
class ImJoyPlugin():
async def setup(self):
pass
async def run(self, ctx):
pass
api.export(ImJoyPlugin())
# https://imjoy.io/docs/#/api?id=apiecho
await api.echo('Hello World')
Unfortunately, we don't have a solution for this for now, due to how jupyter works. See here: ipython/ipykernel#65
Copy my notes here:
Please also note that there is a current limitation with jupyter notebook that the execution will be blocked if you try to run directly await in a cell, see this issue. Instead of doing await my_async_function() directly in a cell, you can do asyncio.ensure_future(my_async_function()).
I was hoping that someone might be able to help me out with a stumbling block that I have hit recently... We are trying to add support for the getter functions in
itkwidgets
, but trying toawait
the response results in a<FuturePromise Pending>
that never resolves and a notebook cell that never exits. It seems that basically anyImJoy
api call or plugin api call that needs to be awaited has this issue (can be reproduced in a notebook with the simple example below). I am wondering if I am missing or misunderstanding something or if this is maybe a bug. Thanks!@oeway @thewtex
The text was updated successfully, but these errors were encountered: