Echo service.
This commit is contained in:
parent
2541fc536a
commit
b6eba60843
@ -127,8 +127,9 @@ class RPCView(BaseView):
|
||||
result = await method(*args)
|
||||
except Exception as ex:
|
||||
result = {"exception": str(ex), "traceback": traceback.format_exc()}
|
||||
success = False
|
||||
await self._send_json({"callId": call_id, "success": success, "data": result})
|
||||
success = False
|
||||
if result != "noresponse":
|
||||
await self._send_json({"callId": call_id, "success": success, "data": result})
|
||||
except Exception as ex:
|
||||
await self._send_json({"callId": call_id, "success": False, "data": str(ex)})
|
||||
|
||||
@ -141,6 +142,9 @@ class RPCView(BaseView):
|
||||
|
||||
return [dict(uid=record['uid'],username=record['username'], nick=record['nick'],last_ping=record['last_ping']) async for record in self.services.channel.get_online_users(channel_uid)]
|
||||
|
||||
async def echo(self, obj):
|
||||
await self.ws.send_json(obj)
|
||||
return "noresponse"
|
||||
|
||||
async def get_users(self, channel_uid):
|
||||
self._require_login()
|
||||
|
Loading…
Reference in New Issue
Block a user