UrbitEx
UrbitEx is an Elixir package to connect to a running Urbit instance.
Installation
The package can be installed by adding urbit_ex to your list of dependencies in mix.exs:
def deps do
[
{:urbit_ex, "~> 0.1.0"}
]
end
Use
After adding it to your dependencies, connect to an Urbit ship by running:
{:ok, pid} = UrbitEx.start(url, code)
e.g. {:ok, pid} = UrbitEx.start("http://localhost", "sampel-sampel-sampel-sampel")
This will start your Urbit ship as a GenServer and start the EventSource pipeline.
You will need to subscribe in order to your Urbit ship to start sending any events. You can do so by running:
UrbitEx.
You can query the GenServer state by running:
GenServer.call(pid, {:get}).
Documentation can be generated with ExDoc and published on HexDocs. Once published, the docs can be found at https://hexdocs.pm/urbit_ex.