# \#state

**URL:** https://forum.elixirforum.com/tag/state/1905.md

[Latest](https://forum.elixirforum.com/latest.md) · [Categories](https://forum.elixirforum.com/categories.md) · [Tags](https://forum.elixirforum.com/tags.md)

---

## [Emerge & Solve - a GUI framework for Elixir](https://forum.elixirforum.com/t/emerge-solve-a-gui-framework-for-elixir/74953)

<div class="topic-metadata">

**Author:** [@Damirados](https://forum.elixirforum.com/u/Damirados)\
**Replies:** 23\
**Last updated:** [August 19, 2026, 9:00pm UTC](https://forum.elixirforum.com/t/emerge-solve-a-gui-framework-for-elixir/74953 "2026-08-19T21:00:44Z")

</div>

Hello everyone. After busy few months I am happy to announce v0.1.0 of Emerge & Solve. They are GUI (Emerge) and State management (Solve) libraries that form a framework when put together even though they don’t depend o…

---

## [Peeper - a library to keep state between crashes and move processes across supervisors](https://forum.elixirforum.com/t/peeper-a-library-to-keep-state-between-crashes-and-move-processes-across-supervisors/70096)

<div class="topic-metadata">

**Author:** [@mudasobwa](https://forum.elixirforum.com/u/mudasobwa)\
**Replies:** 4\
**Last updated:** [March 19, 2026, 5:22am UTC](https://forum.elixirforum.com/t/peeper-a-library-to-keep-state-between-crashes-and-move-processes-across-supervisors/70096 "2026-03-19T05:22:29Z")

</div>

Peeper is a library, that allows to preserve state between process crashes (including ETS and process dictionary,) as well as moving processes across dynamic supervisors (including a distributed transfer across nodes.) I…

---

## [Batching persistence of GenServer state - flagging/updating their information in the Registry?](https://forum.elixirforum.com/t/batching-persistence-of-genserver-state-flagging-updating-their-information-in-the-registry/74384)

<div class="topic-metadata">

**Author:** [@SebAlbert](https://forum.elixirforum.com/u/SebAlbert)\
**Replies:** 4\
**Last updated:** [February 24, 2026, 11:40pm UTC](https://forum.elixirforum.com/t/batching-persistence-of-genserver-state-flagging-updating-their-information-in-the-registry/74384 "2026-02-24T23:40:30Z")

</div>

The Registry module can hold additional data per process / GenServer. Is it a good idea to use this for (micro-)batching the “save state to database” step of GenServers? I have the following idea: Given: I have thousan…

---

## [Maintaining state in a deep map](https://forum.elixirforum.com/t/maintaining-state-in-a-deep-map/73960)

<div class="topic-metadata">

**Author:** [@roganjoshua](https://forum.elixirforum.com/u/roganjoshua)\
**Replies:** 11\
**Last updated:** [January 25, 2026, 9:37am UTC](https://forum.elixirforum.com/t/maintaining-state-in-a-deep-map/73960 "2026-01-25T09:37:47Z")

</div>

Coming from an object-oriented background I am writing a scrabble clone in elixir/phoenix in order to learn elixir and functional programming. So my instinct is to have a state map like so: game\_state = { players: \[ …

---

## [Best way to persist a processes state?](https://forum.elixirforum.com/t/best-way-to-persist-a-processes-state/68404)

<div class="topic-metadata">

**Author:** [@larshei](https://forum.elixirforum.com/u/larshei)\
**Replies:** 18\
**Last updated:** [January 3, 2025, 1:37am UTC](https://forum.elixirforum.com/t/best-way-to-persist-a-processes-state/68404 "2025-01-03T01:37:28Z")

</div>

Hey everyone! Preface Over the last days I started to create an online version of Doppelkopf, a german classical card game, using Elixir/LiveView. The project is still in a pretty basic shape and deployed on fly.io - fe…

---

## [Saving and restoring process state after crash](https://forum.elixirforum.com/t/saving-and-restoring-process-state-after-crash/37537)

<div class="topic-metadata">

**Author:** [@vrod](https://forum.elixirforum.com/u/vrod)\
**Replies:** 7\
**Last updated:** [December 6, 2024, 4:48pm UTC](https://forum.elixirforum.com/t/saving-and-restoring-process-state-after-crash/37537 "2024-12-06T16:48:59Z")

</div>

I am trying to understand more about best practices with Elixir and processes. I thought about a GenServer that would maybe sometimes crash just like more complex real-world examples. defmodule Dynamite.BadCounter do …

---

## [How can I subscribe every liveview in a live\_session to a pubsub topic without custom mount code?](https://forum.elixirforum.com/t/how-can-i-subscribe-every-liveview-in-a-live-session-to-a-pubsub-topic-without-custom-mount-code/63532)

<div class="topic-metadata">

**Author:** [@budgie](https://forum.elixirforum.com/u/budgie)\
**Replies:** 0\
**Last updated:** [May 13, 2024, 11:19am UTC](https://forum.elixirforum.com/t/how-can-i-subscribe-every-liveview-in-a-live-session-to-a-pubsub-topic-without-custom-mount-code/63532 "2024-05-13T11:19:31Z")

</div>

I have an element that may or may not be displayed on every internal page of the application, depending on the application state. I want to be able to update the state globally and in real time without having to manually…

---

## [Process Dictionary vs. Passing State](https://forum.elixirforum.com/t/process-dictionary-vs-passing-state/62237)

<div class="topic-metadata">

**Author:** [@aj-foster](https://forum.elixirforum.com/u/aj-foster)\
**Replies:** 3\
**Last updated:** [March 11, 2024, 8:03pm UTC](https://forum.elixirforum.com/t/process-dictionary-vs-passing-state/62237 "2024-03-11T20:03:27Z")

</div>

tl;dr I have a process that passes around a lot of state. Doing this instead of using the process dictionary affects coding design decisions. What would you do? I have a project that passes around a lot of state. For ex…

---

## [Global state from a sticky liveview?](https://forum.elixirforum.com/t/global-state-from-a-sticky-liveview/61563)

<div class="topic-metadata">

**Author:** [@absowoot](https://forum.elixirforum.com/u/absowoot)\
**Replies:** 6\
**Last updated:** [February 9, 2024, 8:35pm UTC](https://forum.elixirforum.com/t/global-state-from-a-sticky-liveview/61563 "2024-02-09T20:35:24Z")

</div>

I’ve read numerous threads on the forum about maintaining a global state and it appears that the consensus is to utilize ETS ala Cachex, Phoenix Live Session, etc. Before I head down that road, I wanted to see if anyone …

---

## [Is an Elixir GenServer so different from an Object of a Class?](https://forum.elixirforum.com/t/is-an-elixir-genserver-so-different-from-an-object-of-a-class/60290)

<div class="topic-metadata">

**Author:** [@mikejm](https://forum.elixirforum.com/u/mikejm)\
**Replies:** 26\
**Last updated:** [December 12, 2023, 7:44pm UTC](https://forum.elixirforum.com/t/is-an-elixir-genserver-so-different-from-an-object-of-a-class/60290 "2023-12-12T19:44:57Z")

</div>

I am just learning Elixir. The purpose is to build a server API to interact between clients and a separate database server. I am coming from C#/C++. I have now been reading a variety of tutorials on GenServer, as that s…

---

## [Storing Bearer Token for external APIs](https://forum.elixirforum.com/t/storing-bearer-token-for-external-apis/53915)

<div class="topic-metadata">

**Author:** [@ajur58](https://forum.elixirforum.com/u/ajur58)\
**Replies:** 2\
**Last updated:** [February 17, 2023, 9:53am UTC](https://forum.elixirforum.com/t/storing-bearer-token-for-external-apis/53915 "2023-02-17T09:53:47Z")

</div>

Hello everyone, I’m implementing an app that consumes an external API. The API returns a Bearer Token valid for 2 hrs after logging in, to be used for every subsequent request. I’m new to Elixir and was wondering where …

---

## [Share state between nodes and deployments](https://forum.elixirforum.com/t/share-state-between-nodes-and-deployments/53243)

<div class="topic-metadata">

**Author:** [@elixir-is-awesome](https://forum.elixirforum.com/u/elixir-is-awesome)\
**Replies:** 4\
**Last updated:** [January 17, 2023, 10:00pm UTC](https://forum.elixirforum.com/t/share-state-between-nodes-and-deployments/53243 "2023-01-17T22:00:53Z")

</div>

Hello everyone! I was wondering if you could help me try to understand how to implement a “global state” across nodes and keep this state when a new release of my application is deployed. I already tried Nebulex + li…

---

## [What do you usually use for managing reversable procedural code/state changes (Finite State Machine)?](https://forum.elixirforum.com/t/what-do-you-usually-use-for-managing-reversable-procedural-code-state-changes-finite-state-machine/49035)

<div class="topic-metadata">

**Author:** [@jfacoustic](https://forum.elixirforum.com/u/jfacoustic)\
**Replies:** 2\
**Last updated:** [July 19, 2022, 6:44pm UTC](https://forum.elixirforum.com/t/what-do-you-usually-use-for-managing-reversable-procedural-code-state-changes-finite-state-machine/49035 "2022-07-19T18:44:54Z")

</div>

We’re trying to implement a user onboarding path that needs to be able to reverse to the last state on failure. We’ve found a few libraries that could be potential solutions, however they seem relatively inactive. We …

---

## [Advice needed on Genservers vs ETS tables for global state in Phoenix](https://forum.elixirforum.com/t/advice-needed-on-genservers-vs-ets-tables-for-global-state-in-phoenix/44438)

<div class="topic-metadata">

**Author:** [@dredison](https://forum.elixirforum.com/u/dredison)\
**Replies:** 11\
**Last updated:** [December 12, 2021, 7:08pm UTC](https://forum.elixirforum.com/t/advice-needed-on-genservers-vs-ets-tables-for-global-state-in-phoenix/44438 "2021-12-12T19:08:06Z")

</div>

Hi, I’m looking for some advice on making data available to all my LiveComponents without passing it as a prop. I was originally looking at doing this with a simple Genserver, but from the docs, it looks like Genservers…

---

## [Inspect the environment of a Process](https://forum.elixirforum.com/t/inspect-the-environment-of-a-process/44334)

<div class="topic-metadata">

**Author:** [@Astarno](https://forum.elixirforum.com/u/Astarno)\
**Replies:** 7\
**Last updated:** [December 8, 2021, 10:25pm UTC](https://forum.elixirforum.com/t/inspect-the-environment-of-a-process/44334 "2021-12-08T22:25:58Z")

</div>

What would be the correct approach to inspect the current environment of a Process? For example, if I would have a simple Process defined as below: defmodule Stack do def loop(state, ctr) do receive do {\_fro…

---

## [What is the difference between process state and process dictionary?](https://forum.elixirforum.com/t/what-is-the-difference-between-process-state-and-process-dictionary/43937)

<div class="topic-metadata">

**Author:** [@Mukulch15](https://forum.elixirforum.com/u/Mukulch15)\
**Replies:** 7\
**Last updated:** [November 21, 2021, 2:00pm UTC](https://forum.elixirforum.com/t/what-is-the-difference-between-process-state-and-process-dictionary/43937 "2021-11-21T14:00:46Z")

</div>

I read about process dictionaries and how they introduce side effects but how are states different from process dictionaries ? Shouldn’t process states introduce the same issues that process dictionaries have ?

---

## [How to store state in module?](https://forum.elixirforum.com/t/how-to-store-state-in-module/42198)

<div class="topic-metadata">

**Author:** [@quesurifn](https://forum.elixirforum.com/u/quesurifn)\
**Replies:** 5\
**Last updated:** [September 7, 2021, 4:18pm UTC](https://forum.elixirforum.com/t/how-to-store-state-in-module/42198 "2021-09-07T16:18:45Z")

</div>

So, I’m building an SMTP client that I’d like to be able to be called from different processes and have different state for each process. The SMTP client needs to track for example if the HELO command has been used or no…

---

## [Changing GenServer state without blocking calls](https://forum.elixirforum.com/t/changing-genserver-state-without-blocking-calls/41281)

<div class="topic-metadata">

**Author:** [@roeland](https://forum.elixirforum.com/u/roeland)\
**Replies:** 6\
**Last updated:** [July 27, 2021, 10:43pm UTC](https://forum.elixirforum.com/t/changing-genserver-state-without-blocking-calls/41281 "2021-07-27T22:43:07Z")

</div>

Hi, I have a huge map which I store in a GenServer to quickly handle calls. Another process is responsible for creating this map and then sends it to the GenServer. However, as this table is very large, it blocks the Ge…

---

## [View Models/Data Helpers/State Management](https://forum.elixirforum.com/t/view-models-data-helpers-state-management/37807)

<div class="topic-metadata">

**Author:** [@sodapopcan](https://forum.elixirforum.com/u/sodapopcan)\
**Replies:** 5\
**Last updated:** [February 26, 2021, 4:12pm UTC](https://forum.elixirforum.com/t/view-models-data-helpers-state-management/37807 "2021-02-26T16:12:39Z")

</div>

In the 15 minute twitter video, Chris broadcasts the updated Post event with the entity attached which is then simply appended to the list of Posts. This is a simple operation but it does create a little bit of duplicat…

---

## [Best way to propagate state/dependencies?](https://forum.elixirforum.com/t/best-way-to-propagate-state-dependencies/36923)

<div class="topic-metadata">

**Author:** [@pmjoe](https://forum.elixirforum.com/u/pmjoe)\
**Replies:** 1\
**Last updated:** [January 17, 2021, 4:21pm UTC](https://forum.elixirforum.com/t/best-way-to-propagate-state-dependencies/36923 "2021-01-17T16:21:13Z")

</div>

I’m having some questions regards state propagation and making the cost testable. The application is structured in a way that the concurrency comes from the HTTP requests, so the webserver will create a new process for e…

---

## [Using a compile time mutable registry?](https://forum.elixirforum.com/t/using-a-compile-time-mutable-registry/36282)

<div class="topic-metadata">

**Author:** [@binarypaladin](https://forum.elixirforum.com/u/binarypaladin)\
**Replies:** 10\
**Last updated:** [December 18, 2020, 5:52pm UTC](https://forum.elixirforum.com/t/using-a-compile-time-mutable-registry/36282 "2020-12-18T17:52:11Z")

</div>

Let me start by saying that while I have done some basic coding in Elixir and messed with Ecto and Phoenix I am coming from a mostly Ruby/class-based OOP background, and I can tell I have a lot brain-training to do. The …

---

## [Programming Phoenix book: syncing frontend-backend state in example Rumbl app](https://forum.elixirforum.com/t/programming-phoenix-book-syncing-frontend-backend-state-in-example-rumbl-app/34542)

<div class="topic-metadata">

**Author:** [@josefrichter](https://forum.elixirforum.com/u/josefrichter)\
**Replies:** 0\
**Last updated:** [September 23, 2020, 9:14am UTC](https://forum.elixirforum.com/t/programming-phoenix-book-syncing-frontend-backend-state-in-example-rumbl-app/34542 "2020-09-23T09:14:35Z")

</div>

Hello, I’ve been going thru this great book, building the example app, and ran into some issues. I am trying to check whether these issues are “by design” or I understand it incorrectly, or there’s something else to kee…

---

## [Phoenix LiveView client state](https://forum.elixirforum.com/t/phoenix-liveview-client-state/33924)

<div class="topic-metadata">

**Author:** [@tim2CF](https://forum.elixirforum.com/u/tim2CF)\
**Replies:** 1\
**Last updated:** [August 23, 2020, 4:12pm UTC](https://forum.elixirforum.com/t/phoenix-liveview-client-state/33924 "2020-08-23T16:12:49Z")

</div>

Hello! I’m using server-side rendering virtual dom library similar to LiveView, called Replica. Library is very cool, but it miss one feature LiveView has. At the moment Replica can’t resume interactive state after clien…

---

## [Periodically clearing out values store in a process? (i.e. enforcing TTL, e.g. in an Agent)](https://forum.elixirforum.com/t/periodically-clearing-out-values-store-in-a-process-i-e-enforcing-ttl-e-g-in-an-agent/30099)

<div class="topic-metadata">

**Author:** [@fireproofsocks](https://forum.elixirforum.com/u/fireproofsocks)\
**Replies:** 8\
**Last updated:** [March 26, 2020, 11:04pm UTC](https://forum.elixirforum.com/t/periodically-clearing-out-values-store-in-a-process-i-e-enforcing-ttl-e-g-in-an-agent/30099 "2020-03-26T23:04:24Z")

</div>

I’m trying to learn more about use processes to store state (e.g. following this page), and I’m wondering how one might implement a TTL in a value. For example, if I wanted to cache a web request for a short period of t…

---

## [How to keep track of potentially 1000s of events participant cap's change?](https://forum.elixirforum.com/t/how-to-keep-track-of-potentially-1000s-of-events-participant-caps-change/29735)

<div class="topic-metadata">

**Author:** [@benonymus](https://forum.elixirforum.com/u/benonymus)\
**Replies:** 17\
**Last updated:** [March 12, 2020, 5:12pm UTC](https://forum.elixirforum.com/t/how-to-keep-track-of-potentially-1000s-of-events-participant-caps-change/29735 "2020-03-12T17:12:38Z")

</div>

Hey there, I have the following problem: I have events in my database, a lot of them, and the list will only grow. Every event can have multiple ticket types, and each ticket type has a quantity field. The sum of the…

---

## [Worker with state vs Cache + Worker](https://forum.elixirforum.com/t/worker-with-state-vs-cache-worker/28504)

<div class="topic-metadata">

**Author:** [@smanza](https://forum.elixirforum.com/u/smanza)\
**Replies:** 13\
**Last updated:** [January 27, 2020, 4:25am UTC](https://forum.elixirforum.com/t/worker-with-state-vs-cache-worker/28504 "2020-01-27T04:25:10Z")

</div>

Hello ! I’m wondering of the best approach to use regarding data coming from worker processes under supervision tree. Is it better to use state per worker (ie. GenServer, :gen\_statem) and restart over when they fail (w…

---

## [Creating process from GenServer and passing state](https://forum.elixirforum.com/t/creating-process-from-genserver-and-passing-state/26383)

<div class="topic-metadata">

**Author:** [@venomnert](https://forum.elixirforum.com/u/venomnert)\
**Replies:** 6\
**Last updated:** [October 29, 2019, 1:39am UTC](https://forum.elixirforum.com/t/creating-process-from-genserver-and-passing-state/26383 "2019-10-29T01:39:05Z")

</div>

Context: I am pretty new to OTP. In trying to learn it I’m creating an application that does the following (high level overview): users submit X number tasks to a GenServer. The GenServer iterates over the queue of tas…

---

## [Writing a client to fetch data, how to refresh state properly?](https://forum.elixirforum.com/t/writing-a-client-to-fetch-data-how-to-refresh-state-properly/26104)

<div class="topic-metadata">

**Author:** [@nonblockio](https://forum.elixirforum.com/u/nonblockio)\
**Replies:** 1\
**Last updated:** [October 16, 2019, 5:21am UTC](https://forum.elixirforum.com/t/writing-a-client-to-fetch-data-how-to-refresh-state-properly/26104 "2019-10-16T05:21:25Z")

</div>

Hi, I’m writing a client to fetch data from server. I store the token and expire date in GenServer’s state. I’ m wondering how to refresh the token in time properly. One solution is check the expire date before fetch dat…
