MeshxNode.Default (MeshxNode v0.1.0) View Source

Defaults for "node service" and upstream node connections registration parameters with service mesh adapter.

Link to this section Summary

Functions

Returns service params required by c:Meshx.ServiceMesh.start/4 as first argument.

Returns upstream params required by c:Meshx.ServiceMesh.connect/3 as first argument.

Returns sidecar proxy service name used to register upstream connections to other nodes ("nodes services").

Link to this section Functions

Link to this function

service_params(name, host)

View Source

Specs

service_params(name :: atom(), host :: nonempty_charlist()) ::
  {node :: String.t(), node :: String.t()}

Returns service params required by c:Meshx.ServiceMesh.start/4 as first argument.

When node is transformed to distributed one using Node.start/3 or :net_kernel.start/1, special downstream "node service" is registered with :mesh_adapter service mesh adapter using c:Meshx.ServiceMesh.start/4 callback. service_params/2 function return value is passed as first argument to this callback.

Starting node by running Node.start(:mynode@myhost) will register "node service" with params set to: {"mynode@myhost", "mynode@myhost"}.

Function can be overwritten by :service_params config option.

Specs

upstream_params(node :: atom()) :: node :: atom()

Returns upstream params required by c:Meshx.ServiceMesh.connect/3 as first argument.

When connection to other node is requested by Node.connect/1 or :net_kernel.connect_node/1 MeshxNode will ask service mesh adapter to prepare mesh upstream endpoint associated with other node "node service" by running c:Meshx.ServiceMesh.connect/3. upstream_params/1 function return value is passed as first argument to this callback.

Function can be overwritten by :upstream_params config option.

Link to this function

upstream_proxy(node, my_node)

View Source

Specs

upstream_proxy(node :: atom(), my_node :: atom()) ::
  {my_node :: atom(), my_node :: atom()}

Returns sidecar proxy service name used to register upstream connections to other nodes ("nodes services").

Function return value is passed as third argument to c:Meshx.ServiceMesh.connect/3.

Can be overwritten by :upstream_proxy config option.