vdev Knot.Via
Helps building Registry
based process names.
Link to this section Summary
Functions
Builds a via-tuple for a node clients supervisor given an URI
Builds a via-tuple for a node connectors supervisor given an URI
Generates a per-uri unique ID that is suitable for via-tuple generation
Builds a via-tuple for a node listener given an URI
Builds a via-tuple for a node logic given an URI
Given an URI and a suffix, returns a via-tuple compatible with Registry
Builds a via-tuple for a node given an URI
Transforms a URI into a displayable string
Link to this section Types
service_type() :: :node | :clients | :connectors | :logic | :listener
Link to this section Functions
Builds a via-tuple for a node clients supervisor given an URI.
Examples
iex> Knot.Via.clients "tcp://localhost:4001"
{:via, Registry, {Knot.Registry, {"localhost", 4001, :clients}}}
Builds a via-tuple for a node connectors supervisor given an URI.
Examples
iex> Knot.Via.connectors "tcp://localhost:4001"
{:via, Registry, {Knot.Registry, {"localhost", 4001, :connectors}}}
Generates a per-uri unique ID that is suitable for via-tuple generation.
Examples
iex> Knot.Via.id "tcp://localhost:4001", :whatever
{"localhost", 4001, :whatever}
iex> "tcp://localhost:4001" |> URI.parse |> Knot.Via.id(:whatever)
{"localhost", 4001, :whatever}
Builds a via-tuple for a node listener given an URI.
Examples
iex> Knot.Via.listener "tcp://localhost:4001"
{:via, Registry, {Knot.Registry, {"localhost", 4001, :listener}}}
Builds a via-tuple for a node logic given an URI.
Examples
iex> Knot.Via.logic "tcp://localhost:4001"
{:via, Registry, {Knot.Registry, {"localhost", 4001, :logic}}}
Given an URI and a suffix, returns a via-tuple compatible with Registry
.
Examples
iex> Knot.Via.make "tcp://localhost:4001", :whatever
{:via, Registry, {Knot.Registry, {"localhost", 4001, :whatever}}}
iex> "tcp://localhost:4001" |> URI.parse |> Knot.Via.make(:whatever)
{:via, Registry, {Knot.Registry, {"localhost", 4001, :whatever}}}
Builds a via-tuple for a node given an URI.
Examples
iex> Knot.Via.node "tcp://localhost:4001"
{:via, Registry, {Knot.Registry, {"localhost", 4001, :node}}}