View Source Wayfarer.Server behaviour (wayfarer v0.6.1)

A GenServer which manages a proxy.

An appropriate child_spec/1 and start_link/1 are generated when use Wayfarer.Server is called.

You can use this module directly if you are not planning on using the configuration DSL at all.

Example

defmodule MyProxy do
  use Wayfarer.Server, targets: [..], listeners: [..], routing_table: [..]
end

Options

  • :module (module that adopts Wayfarer.Server) - Required. The name of the module which "uses" Wayfarer.Server.

  • :targets (list of keyword/0) - A list of target specifications. The default value is [].

  • :listeners (list of keyword/0) - A list of listener specifications. The default value is [].

  • :routing_table (list of tuple of tuple of , , values, tuple of , , , values, list of String.t/0, values) - A list of routes to add when the server starts. The default value is [].

Summary

Functions

Returns a specification to start this module under a supervisor.

Types

@type options() :: keyword()

Callbacks

@callback child_spec(keyword()) :: Supervisor.child_spec()
@callback start_link(keyword()) :: GenServer.on_start()

Functions

Returns a specification to start this module under a supervisor.

See Supervisor.