mirror of
https://github.com/neovim/neovim.git
synced 2025-12-15 19:05:40 +00:00
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.
This commit is contained in:
@@ -34,8 +34,8 @@ c_params = Ct(c_void + c_param_list)
|
||||
c_proto = Ct(
|
||||
Cg(c_type, 'return_type') * Cg(c_id, 'name') *
|
||||
fill * P('(') * fill * Cg(c_params, 'parameters') * fill * P(')') *
|
||||
Cg(Cc(false), 'deferred') *
|
||||
(fill * Cg((P('FUNC_ATTR_DEFERRED') * Cc(true)), 'deferred') ^ -1) *
|
||||
Cg(Cc(false), 'async') *
|
||||
(fill * Cg((P('FUNC_ATTR_ASYNC') * Cc(true)), 'async') ^ -1) *
|
||||
fill * P(';')
|
||||
)
|
||||
grammar = Ct((c_proto + c_comment + c_preproc + ws) ^ 1)
|
||||
@@ -279,7 +279,7 @@ for i = 1, #functions do
|
||||
'(String) {.data = "'..fn.name..'", '..
|
||||
'.size = sizeof("'..fn.name..'") - 1}, '..
|
||||
'(MsgpackRpcRequestHandler) {.fn = handle_'.. fn.name..
|
||||
', .defer = '..tostring(fn.deferred)..'});\n')
|
||||
', .async = '..tostring(fn.async)..'});\n')
|
||||
|
||||
if #fn.name > max_fname_len then
|
||||
max_fname_len = #fn.name
|
||||
|
||||
Reference in New Issue
Block a user