Crossbar

The Crossbar module provides commands for configuring, starting, and stopping the Crossbar server. You might want to use it for running tests or interactive development.

Why does this module implement the GenEvent behavior? It can be hooked into the ExUnit.EventManager:

ExUnit.start(formatters: [ExUnit.CLIFormatter, Crossbar])

Useful for interactive development, the Crossbar.io server can be started by calling start:

Crossbar.start()

Crossbar.io Dependency

This module requires the Crossbar.io executable. Via pip:

pip install crossbar
Source

Summary

create_config(config \\ [])

Create the Crossbar.io config dir for config

get_config(listener \\ :websocket)

ExUnit setup helper function

get_host()

Return the crossbar host

get_path(atom1)

Get the crossbar resource path

get_port(atom1)

Return the port which the crossbar transport is listening on

get_realm()

Get the default realm

handle_event(arg1, state)

Handle the ExUnit.EventManager events. When the test suite is finished stop the crossbar server

init(args)

Initialize the GenEvent handler with opts

start(options \\ get_config())

Add an event manager with the Crossbar handler to Spell.Supervisor

start_link(options \\ get_config())

Start an event manager with the Crossbar handler

stop()

Stop the Crossbar.io server. This can only be used with start/1

uri(options \\ get_config())

Get the config as a uri

Functions

create_config(config \\ [])

Create the Crossbar.io config dir for config.

Options

  • :crossbar_path :: String.t the path to the Crossbar.io config directory.

See get_config/0 for other options.

Source
get_config(listener \\ :websocket)

ExUnit setup helper function.

Source
get_host()

Specs:

Return the crossbar host.

Source
get_path(atom1)

Specs:

Get the crossbar resource path.

Source
get_port(atom1)

Specs:

  • get_port(:websocket) :: :inet.port

Return the port which the crossbar transport is listening on.

The default value of 8080 can be overrode using the environment variable CROSSBAR_PORT.

Source
get_realm()

Specs:

Get the default realm.

Source
handle_event(arg1, state)

Handle the ExUnit.EventManager events. When the test suite is finished stop the crossbar server.

Source
init(args)

Specs:

  • init(Keyword.t) :: {:ok, t} | {:error, term}

Initialize the GenEvent handler with opts.

Source
start(options \\ get_config())

Specs:

  • start(Keyword.t) :: {:ok, pid} | {:error, any}

Add an event manager with the Crossbar handler to Spell.Supervisor.

Source
start_link(options \\ get_config())

Specs:

  • start_link(Keyword.t) :: {:ok, pid} | {:error, any}

Start an event manager with the Crossbar handler.

Stop the process with:

GenEvent.stop(pid)
Source
stop()

Specs:

  • stop :: :ok | {:error, any}

Stop the Crossbar.io server. This can only be used with start/1.

Source
uri(options \\ get_config())

Specs:

Get the config as a uri.

Source