WardrikChannel. Replies. State
(wardrik_channel v0.1.0-rc.1)
Copy Markdown
The state of one room's replies.
Saved between restarts:
- the cursor past what's posted
- for each conversation, the run under way, the messages it answers and who asked
- the arguments of each conversation's calls
Not saved: the channel, the follower, and when each thread's last status was shown.
Summary
Types
What an event asks to post in its thread. :none posts nothing. The rest match
WardrikChannel.Outbound.body/0, except {:waiting, interrupt_ids, asked_by}.
Functions
Returns the arguments of call id in conversation, or nil if unknown.
Returns who asked for the run under way in conversation, or nil if unknown.
Returns the part of state saved between restarts.
Restores the state from dump/1's result.
Returns the state of a room no one has posted in yet.
Returns what event of conversation asks to post, and the updated state.
Types
@type post() :: {:reply, String.t(), [String.t()]} | {:status, String.t()} | {:waiting, [String.t()], String.t() | nil} | {:failed, String.t()} | {:stopped, [String.t()]} | {:said, String.t()} | :none
What an event asks to post in its thread. :none posts nothing. The rest match
WardrikChannel.Outbound.body/0, except {:waiting, interrupt_ids, asked_by}.
@type t() :: %WardrikChannel.Replies.State{ calls: %{required(String.t()) => %{required(String.t()) => term()}}, channel: WardrikChannel.Channel.t() | nil, cursor: String.t() | nil, follower: pid() | nil, room: String.t(), runs: %{required(String.t()) => run()}, senders: %{required(String.t()) => String.t()}, shown: %{required(String.t()) => integer()}, workspace: String.t() }
Functions
Returns the arguments of call id in conversation, or nil if unknown.
Returns who asked for the run under way in conversation, or nil if unknown.
Returns the part of state saved between restarts.
Restores the state from dump/1's result.
Returns the state of a room no one has posted in yet.
@spec take(t(), String.t(), Wardrik.Event.t()) :: {post(), t()}
Returns what event of conversation asks to post, and the updated state.