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

Check if the Elixir Library Guidelines are followed #2

Open
ejpcmac opened this issue Apr 21, 2018 · 0 comments
Open

Check if the Elixir Library Guidelines are followed #2

ejpcmac opened this issue Apr 21, 2018 · 0 comments

Comments

@ejpcmac
Copy link
Owner

ejpcmac commented Apr 21, 2018

Check for each anti-pattern in the Elixir Library Guidelines.

Anti-patterns

Exceptions used for control flow

Currently, the setup!/0, clear!/0 and drop!/0 in the Helpers module only permit to use exceptions. They are used only in the Mix tasks, but could be also used by a user. This should be enhanced in a next version. Maybe these functions should be undocumented or the control flow changed in the Mix tasks.

Application configuration

plug_session_mnesia is currently configured via the application environment. This is discouraged by the guidelines.

Doing any configuration in the plug initialisation is however a bad idea too: the configuration is then frozen at compile time. Plus, plug_session_mnesia is an application, with running processes like the session cleaner.

The main question regarding this kind of configuration is: what should we do if some user wants two webservers with different plug_session_mnesia configurations?

An idea could be to replace the application by a supervisor accepting the configuration as an argument to its init function. But how should we pass this configuration to the session store?

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

No branches or pull requests

1 participant