diff options
author | Thiago de Arruda <tpadilha84@gmail.com> | 2014-10-20 20:07:01 -0300 |
---|---|---|
committer | Thiago de Arruda <tpadilha84@gmail.com> | 2014-10-21 11:05:49 -0300 |
commit | 72e3e57bf1aa128b02724e853365f65fd9451f0b (patch) | |
tree | 3367aec22475458ea3ed4f3ae9db3a735b08c163 /src/nvim/map.c | |
parent | 72f028abcb167b2ca7e2d6d770af81a18ef58a0a (diff) | |
download | rneovim-72e3e57bf1aa128b02724e853365f65fd9451f0b.tar.gz rneovim-72e3e57bf1aa128b02724e853365f65fd9451f0b.tar.bz2 rneovim-72e3e57bf1aa128b02724e853365f65fd9451f0b.zip |
msgpack-rpc: Allow selective deferral API calls
Since all API functions now run immediately after a msgpack-rpc request is
parsed by libuv callbacks, a mechanism was added to override this behavior and
allow certain functions to run in Nvim main loop.
The mechanism is simple: Any API function tagged with the FUNC_ATTR_DEFERRED (a
"dummy" attribute only used by msgpack-gen.lua) will be called when Nvim main
loop receives a K_EVENT key.
To implement this mechanism it was necessary some restructuration on the
msgpack-rpc modules, especially in the msgpack-gen.lua script.
Diffstat (limited to 'src/nvim/map.c')
-rw-r--r-- | src/nvim/map.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/nvim/map.c b/src/nvim/map.c index 24a869e2e6..3f485cb952 100644 --- a/src/nvim/map.c +++ b/src/nvim/map.c @@ -108,4 +108,5 @@ MAP_IMPL(cstr_t, uint64_t, DEFAULT_INITIALIZER) MAP_IMPL(cstr_t, ptr_t, DEFAULT_INITIALIZER) MAP_IMPL(ptr_t, ptr_t, DEFAULT_INITIALIZER) MAP_IMPL(uint64_t, ptr_t, DEFAULT_INITIALIZER) -MAP_IMPL(String, rpc_method_handler_fn, DEFAULT_INITIALIZER) +#define MSGPACK_HANDLER_INITIALIZER {.fn = NULL, .defer = false} +MAP_IMPL(String, MsgpackRpcRequestHandler, MSGPACK_HANDLER_INITIALIZER) |