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
Summary↑
create_config(config \\ []) | Create the Crossbar.io config dir for |
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 |
init(args) | Initialize the GenEvent handler with opts |
start(options \\ get_config()) | Add an event manager with the |
start_link(options \\ get_config()) | Start an event manager with the |
stop() | Stop the Crossbar.io server. This can only be used with |
uri(options \\ get_config()) | Get the config as a uri |
Functions
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.
ExUnit setup helper function.
Specs:
- get_host :: String.t
Return the crossbar host.
Specs:
- get_path(:websocket) :: String.t
Get the crossbar resource path.
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
.
Specs:
- get_realm :: String.t
Get the default realm.
Handle the ExUnit.EventManager
events. When the test suite is
finished stop the crossbar server.
Specs:
- init(Keyword.t) :: {:ok, t} | {:error, term}
Initialize the GenEvent handler with opts.
Specs:
- start(Keyword.t) :: {:ok, pid} | {:error, any}
Add an event manager with the Crossbar
handler to Spell.Supervisor
.
Specs:
- start_link(Keyword.t) :: {:ok, pid} | {:error, any}
Start an event manager with the Crossbar
handler.
Stop the process with:
GenEvent.stop(pid)
Specs:
- stop :: :ok | {:error, any}
Stop the Crossbar.io server. This can only be used with start/1
.
Specs:
Get the config as a uri.