整体分为 call 和 callback
函数的每个参数及返回值均有一个tag, 可以针对每个tag定制化操作.
declare outer_state
foreach arg
prepare_state()
foreach arg
if is_input
json_to_arg()
call function
foreach arg
if is_output
arg_to_json()
准备状态, 通常用于初始化输出参数
将json
值转换为实际调用时的参数
将(输出/返回)参数转换为json
值
对应位置的schema
类型是否是句柄, 用于给is_handle
提供默认值
参数是否是句柄, 句柄的行为是什么
参数是否是输入, 如果是输入才会触发json_to_arg
调用
参数是否是输出, 如果是输出才会触发arg_to_json
调用
类型是否需要外部状态, 外部状态是什么类型, 用于给is_outer_state
提供默认值
参数是否需要外部状态, 外部状态是什么类型
declare outer_state
get_context()
foreach arg
if is_input
arg_to_json()
call function
foreach arg
if is_output
json_to_arg()
虽然大部分和call是一致的, 但是input/output和arg_to_json/json_to_arg的对应关系交换了
从参数中获取context
将(输出/返回)参数转换为json
值
将json
值转换为实际调用时的参数
对应位置的schema
类型是否是句柄, 用于给is_handle
提供默认值
参数是否是句柄, 句柄的行为是什么
参数是否是输出, 如果是输出才会触发arg_to_json
调用
参数是否是输入, 如果是输入才会触发json_to_arg
调用
类型是否需要外部状态, 外部状态是什么类型, 用于给is_outer_state
提供默认值
参数是否需要外部状态, 外部状态是什么类型