JEG2
Author of Designing Elixir Systems with OTP
I am collecting examples of uses for Agent. I would love to hear uses you can share. Thanks in advance!
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
Hi everyone!
The first release candidate for the Expert language server project is now available!
We’ve published a press release detai...
New
Hi there! :wave:
@frigidcode and I (but mostly him) have been running an Elixir Book club, we’re almost done with Designing Elixir Syste...
New
A little off-topic, but I feel like people here have a good head on their shoulders.
I used to be quite good at making software. Was luc...
New
Other Trending Topics
Edit: 2026 May 15 - This post is archived.
Mob is alive!!
Main docs: mob v0.7.11 — Documentation
A bit of explanation for the slightly c...
New
Hey, I’m Jesse and I’m the main contributor behind Dexter, a full-featured, lightning-fast Elixir LSP optimized for large codebases. It s...
New
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
Just published claude-code-elixir, a plugin marketplace for Claude Code with Elixir support. These are the plugins I’ve been using for my...
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
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
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
- #elixirconf-eu
- #metaprogramming
- #hex










Showing Posts 1 to 10- Show Best Posts
- Show All (oldest first)
- Show All (newest first)
hubertlepicki
Oh I’d love to hear some good use cases too. I sort of feel guilty not using Agent at all. I usually grab GenServer instead without much thinking.
OvermindDL1
Yeah, same here, I always have ‘some’ functionality associated with shared state like that, so a GenServer has always seemed better, otherwise for shared state without functionality then I always use ETS/Mnesia instead… ^.^;
JEG2
I have noticed one place that I tend to use it. I’ll share that later, so as not to bias the answers of others just yet…
JEG2
I find it interesting that not many folks are chiming in with answers yet. I wonder if that signifies that they don’t get a ton of usage.
For myself, I have found them useful in testing other processes. I’ve rigged processes to pull pre-arranged values from them and stored values representing work happening inside of a process that I could later write assertions against.
The one time I tried to use them in an application, I grew to regret it and later replaced them with
GenServerprocesses, for the functionality reasons noted by @OvermindDL1.JEG2
Oops, I did forget another decent usage I found for them!
I recorded the events of a simulation as they happened, then fetched and cleared all changes in the drawing code (using
get_and_update()). That worked fine.jeramyRR
I’ve been wondering the same thing myself. When do people actually use agent?
brightball
I’d thought about using them as a low TTL query cache
michalmuskala
I don’t think I ever used Agent in one of my programs. That said, the use cases in the wild, I saw, are:
sasajuric
I also don’t use Agents for the production runtime code. I did use them on few occasions in tests.
StefanHoutzager
I’m using an agent like KV.bucket: http://elixir-lang.org/getting-started/mix-otp/agent.html. In the following function I’m using an agent as “accumulator”. If there’s a handier solution (I’m not as experienced as most posters) I would like to hear.