mudasobwa
Creator of Cure
Peeper - a library to keep state between crashes and move processes across supervisors
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.)
It keeps both process dictionary and private ETS private. The caveat is all the incoming async messages during a process transfer are to be lost and the huge ETS would have been copied across nodes, which might be not an option.
Excerpt from tests:
{:ok, source_pid} = DynamicSupervisor.start_link(name: SDS)
{:ok, pid} = DynamicSupervisor.start_child(SDS, {MyProcess, state: 0, name: P})
assert 0 == Peeper.call(P, :state)
# creates a private ETS with ‹CONTENT›
assert :ok == Peeper.cast(pid, {:create_ets, :my_ets})
# amends process dictionary
assert :ok == Peeper.cast(pid, {:set_pd, :foo, 42})
# amends process state
assert :ok == Peeper.cast(pid, :inc)
assert 1 == Peeper.call(P3, :state)
Process.exit(Peeper.Supervisor.worker(pid), :kill)
assert 1 == Peeper.call(P, :state)
assert 42 == Peeper.call(P, {:get_pd, :foo})
assert ‹ETS CONTENT› = Peeper.call(P, {:ets, :my_ets})
{:ok, target_pid} = DynamicSupervisor.start_link(name: TDS)
Peeper.transfer(P3, source_pid, target_pid)
assert [{:undefined, pid, :supervisor, _}] = DynamicSupervisor.which_children(TDS)
assert pid == GenServer.whereis(P)
assert 1 == Peeper.call(P, :state)
assert 42 == Peeper.call(P, {:get_pd, :foo})
assert ‹ETS CONTENT› = Peeper.call(P, {:ets, :my_ets})
Most Liked
mudasobwa
Creator of Cure
terminate/2 callback is not guaranteed to be called, unfortunately.
1
Popular in Announcing
Hello!
tl;dr Announcing Oban, an Ecto based job processing library with a focus on reliability and historical observability.
After spen...
New
Hello :waving_hand:
Allow me to introduce you to Tz, an alternative time zone database support to Tzdata.
Why another library?
First a...
New
import Meeseeks.CSS
html = HTTPoison.get!("https://news.ycombinator.com/").body
for story <- Meeseeks.all(html, css("tr.athing")) do...
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
I’ve been working on two packages (not on hex.pm yet) to build admin interfaces for phoenix apps:
bureaucrat - which contains a bunch ...
New
Hello!
Came here to announce ChromicPDF, a pet project PDF generator I’ve been working on for the past few months. Why another PDF gener...
New
parameterized pipe in elixir: |n>
edit: negative index in |n> and mixed usage with |> are supported
example:
use ParamPipe
...
New
LiveMotion enables high performance animations declared on the server and run on the client.
As a follow up to my previous thread A libr...
New
TypeCheck: Fast and flexible runtime type-checking for your Elixir projects.
Core ideas
Type- and function specifications are const...
New
Hey everyone :waving_hand:
Excited to join this forum - I am one of the founders and current project maintainers of a popular and open-s...
New
Other popular topics
Hi All,
I set a environment variables in dev.exs , like below code.
when i start server, how can i set the ${enable} value?
thanks.
d...
New
Hi, this is for people who, like me, have had some friction using .html.heex templates in VSCode.
The solution seems to be, in a hyphena...
New
We have an ECS cluster with 4 services, where each task joins a single cluster, via discovery ECS discovery service.
Currently when I de...
New
What is the difference between System.get_env and Application.get_env? For example, what are best practices to use one versus another.
New
Anybody knows a comprehensive comparison of Django and Phoenix, thanks for the help.
Where are they similar?
Where do they differ the m...
New
Hello, how can I check the Phoenix version ?
Thanks !
New
Hello, I have map which I want to convert it to string like this:
the map:
%{last_name: "tavakkoli", name: "shahryar"}
the string I ne...
New
Hello everybody,
usually, I use a 29" ultra-wide monitor for VSCode which can easily accomodate explorer (files panel) + file with code ...
New
Hey,
Just curious what are the main benefits of Elixir compared to Clojure?
When is Elixir more useful than Clojure and vice versa?
Th...
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









