diff options
author | Alisue <lambdalisue@gmail.com> | 2023-08-06 23:19:29 +0900 |
---|---|---|
committer | Alisue <lambdalisue@gmail.com> | 2023-08-26 19:14:06 +0900 |
commit | 01fe6b9e6a84338d4752c93a286262d79120f163 (patch) | |
tree | e81fa1f15567242a7517ed2d33ae523ba4cd56be /src/nvim/msgpack_rpc/channel_defs.h | |
parent | deb6fd670479b2e00b99481ce59fdc187408d99d (diff) | |
download | rneovim-01fe6b9e6a84338d4752c93a286262d79120f163.tar.gz rneovim-01fe6b9e6a84338d4752c93a286262d79120f163.tar.bz2 rneovim-01fe6b9e6a84338d4752c93a286262d79120f163.zip |
feat(msgpack_rpc): support out-of-order responses on `msgpack-rpc`
Added to support MessagePack-RPC fully compliant clients that do
not return responses in request order.
Although it is currently not an efficient implementation for full
compliance and full compliance cannot be guaranteed, the addition
of the new client type `msgpack-rpc` creates a situation where "if
the client type is `msgpack-rpc`, then backward compatibility is
ignored and full compliance with MessagePack- RPC compliance is
justified even if backward compatibility is ignored if the client
type is `msgpack-rpc`.
Diffstat (limited to 'src/nvim/msgpack_rpc/channel_defs.h')
-rw-r--r-- | src/nvim/msgpack_rpc/channel_defs.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/nvim/msgpack_rpc/channel_defs.h b/src/nvim/msgpack_rpc/channel_defs.h index 1b5f0bb298..79aa8c1b13 100644 --- a/src/nvim/msgpack_rpc/channel_defs.h +++ b/src/nvim/msgpack_rpc/channel_defs.h @@ -14,6 +14,16 @@ typedef struct Channel Channel; typedef struct Unpacker Unpacker; +typedef enum { + kClientTypeUnknown = -1, + kClientTypeRemote = 0, + kClientTypeMsgpackRpc = 5, + kClientTypeUi = 1, + kClientTypeEmbedder = 2, + kClientTypeHost = 3, + kClientTypePlugin = 4, +} ClientType; + typedef struct { uint32_t request_id; bool returned, errored; @@ -37,6 +47,7 @@ typedef struct { uint32_t next_request_id; kvec_t(ChannelCallFrame *) call_stack; Dictionary info; + ClientType client_type; } RpcState; #endif // NVIM_MSGPACK_RPC_CHANNEL_DEFS_H |