aiohttp-json-rpc icon indicating copy to clipboard operation
aiohttp-json-rpc copied to clipboard

Handle batch commands

Open uSpike opened this issue 6 years ago • 1 comments
trafficstars

JSON-RPC 2.0 spec:

6 Batch To send several Request objects at the same time, the Client MAY send an Array filled with Request objects.

This currently (aiohttp-json-rpc 0.12.1) fails as:

future: <Task finished coro=<JsonRpc._handle_rpc_msg() done, defined at venv/lib/python3.6/site-packages/aiohttp_json_rpc/rpc.py:280> exception=AttributeError("'list' object has no attribute 'get'",)>
Traceback (most recent call last):
  File "venv/lib/python3.6/site-packages/aiohttp_json_rpc/rpc.py", line 282, in _handle_rpc_msg
    msg = decode_msg(raw_msg.data)
  File "venv/lib/python3.6/site-packages/aiohttp_json_rpc/protocol.py", line 70, in decode_msg
    raise RpcInvalidRequestError(msg_id=msg_data.get('id', None))
AttributeError: 'list' object has no attribute 'get'

uSpike avatar Apr 09 '19 21:04 uSpike

Hi @uSpike,

Thanks for testing. You are right, support for this feature is missing. Do you have time to implement it?

fscherf avatar Apr 10 '19 08:04 fscherf