Skip to content
This repository was archived by the owner on Aug 16, 2022. It is now read-only.

Commit

Permalink
bump imjoy-rpc version (#234)
Browse files Browse the repository at this point in the history
  • Loading branch information
oeway authored Oct 13, 2021
1 parent 174d59b commit 66089ff
Show file tree
Hide file tree
Showing 8 changed files with 17 additions and 14 deletions.
15 changes: 9 additions & 6 deletions imjoy/core/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ def __init__(self, config, interface, codecs, connection, workspace, user_info):
self.running = False
self.terminating = False
self._api_fut = asyncio.Future()
self._rpc = None

# Note: we don't need to bind the interface
# to the plugin as we do in the js version
Expand Down Expand Up @@ -269,12 +270,14 @@ def imjoy_rpc_ready(data):
async def terminate(self):
"""Terminate."""
try:
if self.api and self.api.exit and callable(self.api.exit):
logger.info(
"Terminating plugin %s/%s", self.config.workspace, self.name
)
self.api.exit()
self._rpc.disconnect()
if self._rpc:
if self.api and self.api.exit and callable(self.api.exit):
logger.info(
"Terminating plugin %s/%s", self.config.workspace, self.name
)
self.api.exit()

self._rpc.disconnect()
finally:
logger.info("Plugin %s terminated.", self.config.name)
self._set_disconnected()
2 changes: 1 addition & 1 deletion imjoy/startup_apps/echo-service.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<title>ImJoy Plugin Template</title>
<meta name="description" content="Template for ImJoy plugin">
<meta name="author" content="ImJoy-Team">
<script src="https://cdn.jsdelivr.net/npm/[email protected].28/dist/imjoy-rpc-socketio.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected].31/dist/imjoy-rpc-socketio.min.js"></script>
<scrpt src="https://cdn.jsdelivr.net/npm/[email protected]/src/pluginParser.js"></scrpt>
</head>

Expand Down
2 changes: 1 addition & 1 deletion imjoy/startup_apps/imjoy-plugin-parser.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<title>ImJoy Plugin Template</title>
<meta name="description" content="Template for ImJoy plugin">
<meta name="author" content="ImJoy-Team">
<script src="https://cdn.jsdelivr.net/npm/[email protected].28/dist/imjoy-rpc-socketio.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected].31/dist/imjoy-rpc-socketio.min.js"></script>
<scrpt src="https://cdn.jsdelivr.net/npm/[email protected]/src/pluginParser.js"></scrpt>
</head>

Expand Down
2 changes: 1 addition & 1 deletion imjoy/templates/web-python-plugin.html
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
async def run():
try:
await micropip.install(["imjoy-rpc>=0.3.30", {% for req in requirements %}"{{req}}", {% endfor %}])
await micropip.install(["imjoy-rpc>=0.3.31", {% for req in requirements %}"{{req}}", {% endfor %}])
# map imjoy_rpc to imjoy
import imjoy_rpc
sys.modules
Expand Down
2 changes: 1 addition & 1 deletion imjoy/templates/web-worker-plugin.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

self.onmessage = function(e) {
const config = e.data
importScripts("https://cdn.jsdelivr.net/npm/[email protected].28/dist/imjoy-rpc-socketio.min.js")
importScripts("https://cdn.jsdelivr.net/npm/[email protected].31/dist/imjoy-rpc-socketio.min.js")

imjoyRPCSocketIO.connectToServer(config).then(async (api)=>{
await imjoyRPCSocketIO.loadRequirements([{% for req in requirements %}"{{req}}", {% endfor %}])
Expand Down
2 changes: 1 addition & 1 deletion imjoy/templates/window-plugin.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<title>ImJoy Plugin Template</title>
<meta name="description" content="Template for ImJoy plugin">
<meta name="author" content="ImJoy-Team">
<script src="https://cdn.jsdelivr.net/npm/[email protected].28/dist/imjoy-rpc-socketio.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected].31/dist/imjoy-rpc-socketio.min.js"></script>
</head>

<body>
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ aiobotocore==1.4.2
aiofiles==0.7.0
fastapi==0.70.0
imjoy-jupyter-extension==0.2.17
imjoy-rpc==0.3.30
imjoy-rpc==0.3.31
ipykernel==6.4.1
jinja2==3.0.1
jupyter==1.0.0
Expand Down
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@
# pylint: disable=unused-import
import google.colab.output # noqa: F401

REQUIREMENTS = ["numpy", "imjoy-rpc>=0.3.30", "imjoy-elfinder"]
REQUIREMENTS = ["numpy", "imjoy-rpc>=0.3.31", "imjoy-elfinder"]
except ImportError:
REQUIREMENTS = [
"aiobotocore>=1.4.2",
"aiofiles",
"fastapi>=0.70.0",
"imjoy-rpc>=0.3.30",
"imjoy-rpc>=0.3.31",
"msgpack>=1.0.2",
"numpy",
"pydantic[email]>=1.8.2",
Expand Down

0 comments on commit 66089ff

Please sign in to comment.