multiverses v0.5.1 Multiverses.GenServer View Source
This module is intended to be a drop-in replacement for use GenServer
.
Note that this is different from other modules.
Usage
defmodule MyModule do
use Multiverses, with: GenServer
use GenServer
def start_link(...) do
GenServer.start_link(__MODULE__, init, forward_callers: true)
end
#
# standard GenServer code.
#
end
The Multiverses.GenServer implementation introduces a :forward_callers
option into the GenServer init, setting this to true, allows the
GenServer to inherit the callers chain of its caller. This is compatible
with Multiverses.DynamicSupervisor
.
Important:
Typically you won't want GenServers to default to be part of a multiverse shard, as they generally represent stateful persistent internal services. If the service can exist before and after the test, then you should consider NOT using this module.
When you should use this module:
In some cases, a GenServer will represent a transient connection, or a cache for state IRL which is tracked in a specific context.
Link to this section Summary
Functions
cloned from GenServer.abcast/2
cloned from GenServer.abcast/3
cloned from GenServer.call/2
cloned from GenServer.call/3
cloned from GenServer.cast/2
cloned from GenServer.format_report/1
cloned from GenServer.multi_call/2
cloned from GenServer.multi_call/3
cloned from GenServer.multi_call/4
cloned from GenServer.reply/2
starts a GenServer, linked to the calling function.
starts a GenServer, linked to the calling function.
cloned from GenServer.stop/1
cloned from GenServer.stop/2
cloned from GenServer.stop/3
cloned from GenServer.whereis/1
Link to this section Functions
cloned from GenServer.abcast/2
cloned from GenServer.abcast/3
cloned from GenServer.call/2
cloned from GenServer.call/3
cloned from GenServer.cast/2
cloned from GenServer.format_report/1
cloned from GenServer.multi_call/2
cloned from GenServer.multi_call/3
cloned from GenServer.multi_call/4
cloned from GenServer.reply/2
starts a GenServer, linked to the calling function.
starts a GenServer, linked to the calling function.
cloned from GenServer.stop/1
cloned from GenServer.stop/2
cloned from GenServer.stop/3
cloned from GenServer.whereis/1