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_auth_port(binary1) | Return the port which the crossbar raw_socket auth is listening on |
get_config(transport \\ app_transport()) | Get the crossbar config |
get_host() | Return the crossbar host |
get_path(binary1) | Get the crossbar resource path |
get_port(binary1) | 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(), transport \\ app_transport()) | Get the config as a uri |
uri_auth(options \\ get_config(), transport \\ app_transport()) | Hack to get the auth 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.
Specs:
- get_auth_port(String.t) :: :inet.port
Return the port which the crossbar raw_socket auth is listening on.
The default value of 9001
for raw_socket can be
overrode using the environment variable CROSSBAR_AUTH_PORT_RS
.
Specs:
Get the crossbar config.
Specs:
- get_host :: String.t
Return the crossbar host.
Specs:
Get the crossbar resource path.
Specs:
- get_port(String.t) :: :inet.port
Return the port which the crossbar transport is listening on.
The default value of 8080
for websocket and 9000
for raw_socket can be
overrode using the environment variables CROSSBAR_PORT_WS
and CROSSBAR_PORT_RS
.
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.
Specs:
Hack to get the auth uri.
TODO: support this as part of templating out the config file.