hotpancakes
Here’s a quick overview of the major changes:
- A solution to the problem of runtime configuration
- Improved experience around hot upgrades/downgrades, namely better support for custom appups and programmatically modifying them
- Out of the box support for generating PID files
- Better and more consistent primitives for custom commands and hooks
- Improved errors and better feedback from the CLI
- Major improvements to the documentation: new guides, better organization, searchable docs, and more
Trending in Discussions
As the title says, please share what you’ve been up to with Elixir. Whether that’s been learning it, looking into it, making stuff with i...
New
Hey there,
It’s been more than a year since we started using LiveView as our main UI library and building a whole library of UI componen...
New
I am happy to introduce the very α version of the new programming language compiled to BEAM.
Welcome Cure.
It has literally three kille...
New
Quite interesting article Google brought me. Didn’t find any mentions about it here.
What do you think in general? Would you use togethe...
New
:warning: Security advisory: Decimal DoS vulnerability
A vulnerability has been published for decimal where very large exponents can cau...
New
It would be helpful to have a list of companies worldwide that hire engineers without prior experience in Elixir. Often, it can be quite ...
New
What IDE or editor are you using for Elixir development?
Personally, I use Zed, and I really like it, but sometimes I wish there were a ...
New
Other Trending Topics
Hi there! We created Gust: A task orchestrator inspired by Airflow.
For those who have never heard about Aiflow, it’s a Python-based wor...
New
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New
Xamal is a deployment tool for Elixir apps that deploys native releases to bare metal servers over SSH. It’s a port of GitHub - basecamp/...
New
Corex is an accessible, unstyled UI component library for Phoenix that integrates Zag.js state machines using Vanilla JavaScript and Live...
New
With AI doing more of the implementation work, I’ve been wondering how much coding I should deliberately keep doing myself.
My main conc...
New
Aludel - LLM Evaluation Workbench
Aludel is an embeddable Phoenix LiveView dashboard for evaluating and comparing LLM prompts across mult...
New
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #library
- #deployment
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #elixirconf
- #channels
- #exunit
- #discussion
- #code-sync
- #podcasts
- #javascript
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #ai
- #elixirconf-us
- #blog-post
- #elixir-ls
- #phoenix_html
- #iex
- #graphql
- #genstage
- #websockets
- #supervisor
- #advent-of-code
- #distillery
- #processes
- #api
- #forms
- #hex
- #security
- #metaprogramming










Showing Posts 34 to 25- Show Best Posts
- Show All (oldest first)
- Show All (newest first)
dimitarvp
Even better. Just pointing it out for him to update the link.
AstonJ
It’s a tag now deployment so that threads about Elixir/Phoenix/Nerves deployment threads can be posted in their respective sections yet still be tracked easily
dimitarvp
@bitwalker just a quick note: your GitHub
README.mdpoints to ElixirForum section that no longer exists.bitwalker
For runtime reconfiguration of anything that impacts the state of running processes, it is expected that you would use the
config_changehandler in the application callback module - when this is invoked it ensures that you can execute configuration changes in a predictable and coordinated fashion.The problem with just hitting
Application.get_env/3everywhere when it comes to reconfiguration, is that you can’t guarantee anything about when you will fetch values from there. For example, you may fetch two values fromApplication.get_env/3in the same function, both of which depend or are related to each other in some way - if configuration changes are being applied while that function is executing, you may get a mix of old and new values, which result in odd or unexpected behavior. By instead coordinating the config changes with the processes which need to change, you get predictable results, and can make sure that trickier config changes, such as changing the port a socket is listening on, etc., are performed correctly.For something like your Logger example, yes, fetching directly from the application env may work just fine, and may even be preferable if it is something you need to do often - but cases where you can safely reconfigure things on the fly like that without any guarantees are less common, I think, than cases where the configuration has impacts on the state of a process, or many processes, or may even change the behavior of the application entirely (such as changing the implementation module for some behavior).
You don’t have to implement config change handling in every process, you implement it in the application callback module, and orchestrate the configuration changes from there. This may mean talking to processes when they need to perform some work to reconfigure themselves, it may mean starting new children under a supervisor and terminating old ones, or it may not require any implementation work at all. For convenience, it may make sense to have
config_changefunctions defined at the supervisor or process level, and have the applicationconfig_changefunction call those functions, but it’s certainly not required.Yes, I’m not arguing that you should never use
Application.get_env/3, there are still times where that is useful or convenient - but you should prefer configuration by parameters where possible, especially in libraries, because you don’t know ifApplication.get_envis going to be convenient for your users. This is a huge part of why runtime configuration has been such an issue with releases historically - libraries leaned too heavily on application env, rather than on designing APIs which are configurable, and it made it very difficult to configure them (naturally), as a result. Using application env is painful even outside of releases for similar reasons - it’s just another form of global state, which means that if you need to change that state, or run multiple configurations side-by-side, you can’t.bitwalker
Windows support is being rewritten right now in Distillery because most of the functionality available on *Nix is unsupported on Windows due to the difficulty of porting that functionality to batch script. While Distillery 2.0 did work on Windows during the RC period, last minute changes to the way config providers worked were not propagated to the Windows scripts because I’m in the middle of that rewrite (basically porting all of the bash scripts to Powershell, rather than porting the batch scripts, since they are horrendous).
Also, reporting issues is important feedback - there is no guarantee I will see a message like yours here on this forum, or elsewhere for that matter. If you want to make sure issues get fixed, reporting issues is critical.
xlphs
So I deploy to Windows… basically tried to upgrade from exrm to distillery today, the cookie part (I think) doesn’t work, my server starts C nodes and they weren’t able to talk to each other. Went back to exrm and everything just worked again. I know exrm is not supported but it kinda just works.
liveforeverx
Example, log level, it happens at boot, but you want to reconfigure it without restarting of application. So, they are not always different things. It happens at boot time, but still can be reconfigured. And we got, that Logger application reinvented application environments with own GenServer and ETS table.
I would say, that most configuration of application(which is not compile-time configuration) should be defined at boot and where possible reconfigurable in runtime, like log level, it is just a perfect example. It is my personal opinion: that’s is best for user experience, what you can do.
jeremyjh
I think there are two stages of propagation - that which happens at boot - which is only for configuration that will never change during runtime. And propagation per request, where the state is fetched for each request, so will always be current. For example a plug putting config data into the
%Conn{}.Cases that are neither of these would need to directly use
get_envorconfig_changeI think.liveforeverx
Fetching and pushing configuration down the tree has one disadvantage on dealing with reconfiguration, where you need to implement for every configuration mechanism for reconfiguration.
With application environments, changes are propagated automatically, if fetched every time via
Application.get_env, otherwise there is application callback to useconfig_change, where you can make call/send messages to a processes to reconfigure, restart processes(if listening port changes) and so on.Runtime reconfiguration is important topic by dealing with configuration and it works for application environment (
Application.get_envor config_change application callback) and a question how it should work with propagating configuration to the tree? Implement somehow change_config by every process? Implementconfig_changein application?I can’t think about dealing with configuration, without dealing with runtime reconfiguration, and
Application.get_envdirect call is the simple way to deal with it and may be should used, where it still make sense?. Andconfig_changeallows to implement it, where processes save configuration in a state(or for example bind on another port).jeremyjh
Thanks, that does clarify it quite a bit. I agree with this but thought there was maybe another mechanism I’d overlooked.