STPeters/luafcgid — Issue #17: Replacement for os.exit()
Author: buzzy
Created: 2012-02-16 20:16:52+00:00
State: open

Is it possible to add a function that you can expose to Lua that exits the main() function?

If I do a os.exit() somewhere in my code, it will kill the luafcgid worker.

I usually have deep-nested code, like running a function in main(), that runs a function, that runs a function.... etc.

Currently, if I want to end the execution of a script in the deepest level, I need to do "returns" all the way down to main() with IF-statements etc.

Would be a lot easier if I could do something like "cgi.exit()" that just end the execution of the script without killing the whole fastcgi worker.

It would also make my code a lot cleaner :)