RaftEx.ServerSupSupervisor (raft_ex v0.1.0)

View Source

Dynamic supervisor that owns one RaftEx.ServerSupervisor per server that has been started on this node.

All RPC-style functions that operate on remote nodes delegate to their _rpc counterparts via :rpc.call/4.

Summary

Functions

Returns a specification to start this module under a supervisor.

Stop and permanently delete a server, removing its data directory.

Keys that callers are permitted to override when restarting a server.

Restart a previously started server, merging in add_config overrides.

Start a new server on the node specified by config.id.

Stop a running server (does not delete its data).

Functions

child_spec(arg)

Returns a specification to start this module under a supervisor.

See Supervisor.

delete_server(system, server_id)

@spec delete_server(atom(), RaftEx.Types.server_id()) :: :ok | {:error, term()}

Stop and permanently delete a server, removing its data directory.

mutable_config_keys()

@spec mutable_config_keys() :: [atom()]

Keys that callers are permitted to override when restarting a server.

restart_server(system, arg, add_config)

@spec restart_server(atom(), RaftEx.Types.server_id(), map()) ::
  DynamicSupervisor.on_start_child() | {:error, term()}

Restart a previously started server, merging in add_config overrides.

start_link(cfg)

start_server(system, config)

@spec start_server(atom(), map()) :: DynamicSupervisor.on_start_child()

Start a new server on the node specified by config.id.

stop_server(system, server_id)

@spec stop_server(atom(), RaftEx.Types.server_id()) :: :ok | {:error, term()}

Stop a running server (does not delete its data).