Cizen v0.12.5 Cizen.Request behaviour View Source

An event to request.

Link to this section Summary

Functions

Defines a response event

Callbacks

Returns event filters to subscribe the response of the given event

Link to this section Functions

Link to this macro defresponse(module, key, list) View Source (macro)

Defines a response event.

Example

defmodule Request do
  defstruct [:value]
  use Cizen.Request
  defresponse Accept, :request_id do
    defstruct [:request_id, :value]
  end
  defresponse Reject, :request_id do
    defstruct [:request_id, :value]
  end
end

Link to this section Callbacks

Link to this callback response_event_filter(arg0) View Source
response_event_filter(Cizen.Event.t()) :: Cizen.Filter.t()

Returns event filters to subscribe the response of the given event.