Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lua init script #103

Open
linkerlin opened this issue Jun 24, 2022 · 3 comments
Open

Lua init script #103

linkerlin opened this issue Jun 24, 2022 · 3 comments
Assignees
Labels
question One or more questions

Comments

@linkerlin
Copy link

How about added a init.lua for algernon initial?

@linkerlin
Copy link
Author

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

@xyproto
Copy link
Owner

xyproto commented Jun 24, 2022

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 xyproto self-assigned this Jun 24, 2022
@xyproto xyproto added the question One or more questions label Jun 24, 2022
@xyproto xyproto changed the title [ROADMAP] Make lua as a initer for algernon? Lua init script Jun 24, 2022
@tooolbox
Copy link
Collaborator

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question One or more questions
Projects
None yet
Development

No branches or pull requests

3 participants