🗒️apisix源码分析-插件的运行(7)
2023-8-22
| 2023-8-29
0  |  0 分钟
type
status
date
slug
summary
tags
category
icon
password

插件的运行

插件的 init_worker 监控了 etcd 的 pluglns 。
插件列表发生发生变化时通过 load 函数重新加载插件 。
load 函数获取启用的插件列表后,清理本地的插件,使用 load_plugin 函数通过 pcall(require, pkg_name)重新引入插件
 
插件在每个阶段通过 common_phase(phase_name) 来执行。执行流程如下:
  • 执行公共插件
  • 插件调用阶段 run_plugin(phase,plugins,api_ctx)
  • api_ctx.script_obj : 当使用有向无环图来做编辑时,apisix 会将图转换为脚本存储到 script_obj 变量中。
apisix
  • apisix
  • apisix源码分析-路由高性能的秘密 redix tree(8)apisix源码分析-route的匹配(6)
    目录