fix start/stop methods

This commit is contained in:
marios8543
2023-10-18 15:34:25 +03:00
parent 88250b3e20
commit 934b1b35ad
+2 -2
View File
@@ -65,14 +65,14 @@ class PluginWrapper:
return await request.wait_for_result()
async def start(self):
def start(self):
if self.passive:
return self
Process(target=self.sandboxed_plugin.initialize, args=[self._socket]).start()
self.listener_task = create_task(self._response_listener())
return self
async def stop(self):
def stop(self):
self._listener_task.cancel()
async def _(self: PluginWrapper):
await self._socket.write_single_line(dumps({ "stop": True }, ensure_ascii=False))