Plushie.Event.StreamEvent (Plushie v0.6.0)

Copy Markdown View Source

Intermediate values from Plushie.Command.stream/2 tasks.

Fields

  • tag -- the user-defined atom tag from the command
  • value -- the intermediate value emitted by the stream

Pattern matching

def update(model, %StreamEvent{tag: :download, value: %{progress: p}}), do: ...
def update(model, %StreamEvent{tag: :search, value: result}), do: ...

Summary

Types

t()

@type t() :: %Plushie.Event.StreamEvent{tag: atom(), value: term()}