From ccdeb91e1206f38773664979bf03694213a2ba80 Mon Sep 17 00:00:00 2001 From: Thiago de Arruda Date: Fri, 24 Jul 2015 09:55:31 -0300 Subject: msgpack: Replace FUNC_ATTR_DEFERRED by FUNC_ATTR_ASYNC API functions exposed via msgpack-rpc now fall into two categories: - async functions, which are executed as soon as the request is parsed - sync functions, which are invoked in nvim main loop when processing the `K_EVENT special key Only a few functions which can be safely executed in any context are marked as async. --- src/nvim/msgpack_rpc/defs.h | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src/nvim/msgpack_rpc/defs.h') diff --git a/src/nvim/msgpack_rpc/defs.h b/src/nvim/msgpack_rpc/defs.h index 0492a65290..d97cf28ca1 100644 --- a/src/nvim/msgpack_rpc/defs.h +++ b/src/nvim/msgpack_rpc/defs.h @@ -11,9 +11,8 @@ typedef struct { uint64_t request_id, Array args, Error *error); - bool defer; // Should the call be deferred to the main loop? This should - // be true if the function mutates editor data structures such - // as buffers, windows, tabs, or if it executes vimscript code. + bool async; // function is always safe to run immediately instead of being + // put in a request queue for handling when nvim waits for input. } MsgpackRpcRequestHandler; /// Initializes the msgpack-rpc method table -- cgit