UrbitEx.Session (UrbitEx v0.6.5) View Source

GenServer to keep state of an Urbit Session. Creates a struct keeping track of global data, and client functions to add and remove channels.

Link to this section Summary

Functions

Creates an eyre channel and attackes it to the session Takes a keyword list with three optional keys: :name to give the new channel, :parent, name or pid of the parent session, and :keep_state, a boolean to determine whether the channel should send events for automatic state-keeping by the parent session. Takes a pid or atom name of the server to reset, an url string and a cookie string.

Returns a specification to start this module under a supervisor.

Closes an open eyre channel. Takes a pid or atom name of the parent session, and atom name or pid of the channel to close. Returns :ok

Returns the state of the Session. Takes a pid or atom name of the Session process. Aliased as UrbitEx.get.

Resets state with a new url and cookie. Takes a pid or atom name of the server to reset, an url string and a cookie string.

Starts the GenServer as an unlinked process. Takes a keyword list with initialization options, and an atom to name the process.

Starts the GenServer as a linked process. Takes a keyword list with initialization options, and an atom to name the process.

Link to this section Functions

Creates an eyre channel and attackes it to the session Takes a keyword list with three optional keys: :name to give the new channel, :parent, name or pid of the parent session, and :keep_state, a boolean to determine whether the channel should send events for automatic state-keeping by the parent session. Takes a pid or atom name of the server to reset, an url string and a cookie string.

Returns a specification to start this module under a supervisor.

See Supervisor.

Link to this function

close_channel(pid \\ :urbit, name)

View Source

Closes an open eyre channel. Takes a pid or atom name of the parent session, and atom name or pid of the channel to close. Returns :ok

Returns the state of the Session. Takes a pid or atom name of the Session process. Aliased as UrbitEx.get.

Link to this function

reconnect(pid, url, cookie)

View Source

Resets state with a new url and cookie. Takes a pid or atom name of the server to reset, an url string and a cookie string.

Link to this function

save_contacts(pid, contacts)

View Source
Link to this function

set_value(pid, key, value)

View Source
Link to this function

start(options \\ [], name \\ :urbit)

View Source

Starts the GenServer as an unlinked process. Takes a keyword list with initialization options, and an atom to name the process.

Link to this function

start_link(options \\ [], name \\ :urbit)

View Source

Starts the GenServer as a linked process. Takes a keyword list with initialization options, and an atom to name the process.