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
We should expose the getter functions to users so that they can access the information that they may need. Currently progress on this is barred by two issues, the first of which being the major barrier:
(Highest Priority) For some reason we currently get stuck with awaiting the results. Calling the ImJoyPluginAPI we can see that the value is retrieved, but for some reason the <FuturePromise pending> never resolves when we await it. Can be reproduced with the following:
from imjoy_rpc import api
import imageio.v2 as imageio
image = imageio.imread("https://data.kitware.com/api/v1/file/5b843d468d777f43cc8d4f6b/download/engine.nrrd")
class ImJoyPlugin():
async def setup(self):
pass
async def run(self, ctx):
# create a viewer
viewer = await api.createWindow(src="https://bafybeicuvbx4cfp3zgo25j376bmmysh73a2ui5dbapuwqtmjcvcaipmpbi.on.fleek.co/")
# show an image
viewer.setImage(image)
async def getUICollapsed(self):
return await self.viewer.getUICollapsed()
viewer = ImJoyPlugin()
api.export(viewer)
await viewer.getUICollapsed()
(Useful but lower priority) To handle the case of "Run All" we need to think about how to handle calls to these getters so that they don't produce errors that interrupt the notebook. Some ideas:
Use the background thread like we do with the setters. In this case we would need to rethink the current approach a little to make sure we get the result back. We'd also need a way to associate the result with the correct cell. Would also need a "placeholder" for the returned value to indicate that it hasn't yet returned even though the cell has "completed". Less than ideal.
Try to move the rpc to the background thread so that cells can block while they wait for results.
The text was updated successfully, but these errors were encountered:
We should expose the getter functions to users so that they can access the information that they may need. Currently progress on this is barred by two issues, the first of which being the major barrier:
<FuturePromise pending>
never resolves when weawait
it. Can be reproduced with the following:The text was updated successfully, but these errors were encountered: