On Apr 16, 2014, at 8:19 PM, ????(????) <que...@taobao.com> wrote: > Maybe we can use the same lua_States in both remap and global plugins. > >
Not exactly related, but one thing that really bothers me with the new plugin is how in a remap rule (do_remap()) it always saves away the context, and creates a new TXN continuation to free it at the end of the TXN. That seems like a waste for many (not all) remap type plugins, which just do rewrites of URLs (why does the CTX have to persist?). One thing that we should consider now that Lua is part of the core is to add stuff to e.g. the HttpSM. For example, maybe we can have Lua CTX member(s) there, and do automatic cleanup if set (i.e. avoid the ??cleanup?? continuation)? That would imply adding new plugin APIs, such as TSLuaContextSet(txnp, ctx) and ctx = TSLuaContextGet(txnp). But, regardless, start thinking about how Lua should integrate better with the core :). We can / should assume that Lua is always available, and long term, the consensus was to try to move most (if not all) into the core. Cheers, ?? Leif