On Apr 17, 2014, at 9:01 AM, Leif Hedstrom <zw...@apache.org> wrote: > > 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).
If you want to pull Lua into core, why would you need a lua plugin at all? Surely the core would just execute lua code in that case. If the config is lua too, then remapping could be a matter of just attaching a lua function to a URL matching expression. > 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 >