This should mitigate any memory leaks in user code, and it's supposed not to store anything in globals anyway so the more we enforce this the better.
We can't have one instance per function called however, given that it'd require re-running the setup function all the time and that'd be slow.
Actually… maybe it'd make sense to reload the whole instance on every call? But only in a “configuration-check” mode, where kannader would be checking its configuration to be valid, to easily make sure the configuration isn't storing anything in globals.
This should mitigate any memory leaks in user code, and it's supposed not to store anything in globals anyway so the more we enforce this the better.
We can't have one instance per function called however, given that it'd require re-running the setup function all the time and that'd be slow.
Actually… maybe it'd make sense to reload the whole instance on every call? But only in a “configuration-check” mode, where kannader would be checking its configuration to be valid, to easily make sure the configuration isn't storing anything in globals.