Asd
AtomicFlags - mutable runtime configuration on top of atomics
A very short and simple library which implements compile-time enums on top of erlang :atomics module.
Use cases
- Configuration, where values change in runtime
- Configuration, where values are accessed frequently and accessing them become a bottleneck
- Inter-process store for some flags, options or parameters.
Example
defmodule FeatureFlags do
use AtomicFlags, schema: [
feature_enabled: [false, true]
]
end
iex> require FeatureFlags
iex> flags = FeatureFlags.new()
iex> FeatureFlags.set(flags, :feature_enabled, true)
iex> FeatureFlags.get(flags, :feature_enabled)
true
Or with global: true
defmodule GlobalFeatureFlags do
use AtomicFlags,
global: true,
schema: [
feature: [:disabled, :for_preview, :enabled]
]
end
iex> require GlobalFeatureFlags
iex> GlobalFeatureFlags.new_global()
iex> GlobalFeatureFlags.set(:feature, :for_preview)
iex> GlobalFeatureFlags.get(:feature)
:for_preview
My experience
I am using a version of this library in my pet project and it is working fine, showing really good performance, compared to application env ets
First Post!
thiagomajesk
Great job! Slap a live dashboard page on top of it for configuration, and then you can compete directly with LaunchDarkly, haha ![]()
0
Popular in Announcing
I’ve published the first version of my Makeup library. It’s a syntax highlighter for Elixir in the spirit of Pygments, Currently it highl...
New
I am pleased to announce an initial release of the Membrane Framework - an Elixir-based framework with special focus on processing multim...
New
Hello everybody :wave:
Recently, some of my colleagues talked about database ids and uuids and their problems, and I remembered the pain...
New
Hello everyone!
I want to share with you something that I’m really proud of: https://stillstatic.io/
Still is a static site builder for...
New
LangChain is short for Language Chain. An LLM, or Large Language Model, is the “Language” part. This library makes it easier for Elixir a...
New
I created Kitto a framework for dashboards inspired by Dashing.
The distributed characteristics of Elixir and the low memory footprint...
New
Hey everyone!
Req is an HTTP client for Elixir that I’ve been working on for quite some time. There is already a lot of HTTP clients out...
New
Just looking for a little feedback on a tiny helper library I built -
Sometimes I find the need to convert maps with atom keys to maps w...
New
Hello everyone,
We have just released NimbleCSV which is a small and fast CSV parsing library for Elixir. It allows developers to define...
New
simple_feature_flags is a tiny package that lets you turn features on or off based on which environment (e.g. localhost, staging, product...
New
Other popular topics
As promised, the first release candidate of Phoenix 1.3.0 is out! This release focuses on code generators with improved project structure...
New
Hello all!
I am typing this post from my new MacBook Pro with the M1 chip. I’m loving it so far, and will probably use it as my daily dr...
New
I believe there are people here who are dealing with CSV files import on the daily basis, and since Excel is a really popular tool there ...
New
What learn first? Rust or Elixir
Hi Elixir community!
I’m here because i want learn a new language. I’m a junior developer and mainly i ...
New
I asked this very same question on twitter and got some interesting feedback, but I thought it would be a good question to ask here as we...
New
As the title describes, I’m trying to run Enum.map() over a list of key/value pairs, where the value is a map. My data looks like this:
...
New
Hello everyone,
Long time lurker first time poster here. I’ve recently begun working on Elixir full-time again! :raised_hands: It’s been...
New
I wrote this comment on r/haskell, and it’s not popular there. :wink: But I think I’m on to something…
Haskell reminds me of Java, and e...
New
I want to highlight html closing tags when i click a html tag. That works in .html files but doesnt work for html.eex templates. How can...
New
Hi!
Currently I want to submit a form by pressing the Enter key. However, since my input field is of type “textarea” this is just adds a...
New
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #deployment
- #library
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #channels
- #elixirconf
- #exunit
- #discussion
- #code-sync
- #javascript
- #podcasts
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixir-ls
- #phoenix_html
- #iex
- #blog-post
- #graphql
- #genstage
- #ai
- #websockets
- #supervisor
- #advent-of-code
- #elixirconf-us
- #distillery
- #processes
- #forms
- #api
- #metaprogramming
- #security
- #performance









