algernon icon indicating copy to clipboard operation
algernon copied to clipboard

Lua init script

Open linkerlin opened this issue 2 years ago • 3 comments

How about added a init.lua for algernon initial?

linkerlin avatar Jun 24 '22 05:06 linkerlin

Maybe algernon can be a bettery-included soulution for lua programmers.

linkerlin avatar Jun 24 '22 05:06 linkerlin

Algernon does support initial Lua scripts, for instance serverconf.lua or /etc/algernon/server.lua. Is this what you had in mind, or does init.lua imply something else?

Algernon coming with everything a Lua programmer would need to create a web application is a goal, yes.

xyproto avatar Jun 24 '22 10:06 xyproto

@xyproto in this vein, one thing I discovered while adding Teal support is that it seems like new Lua states are spun up without having serverconf.lua run on them. I.e., only the first state created executes that script while subsequent ones generated for the state pool are virgin.

This makes a degree of sense, because serverconf.lua sets configuration for the server and you probably don't want those things re-running every time Algernon adds to the Lua state pool. But it also means you have no hook to reliably initialize every Lua state that is created.

I could be wrong on this, feel free to set me straight. Also, I have no specific need for this feature at this time, just commenting on the above.

tooolbox avatar Jun 24 '22 15:06 tooolbox