hivent v3.0.0 Hivent.Emitter

The Hivent Emitter module. It emits signals into a Hivent Server instance through a Websocket.

Summary

Types

A Hivent Event struct

Return values of start* functions

Functions

Emits the given event with name, payload and options

Options

  • :version
  • :cid optional
  • :key optional, will be derived from payload by default. It controls which partition the event is stored in.

Example

Emitter.emit(
  "my:event",
  %{foo: "bar"},
  %{version: 1, cid: "a_correlation_id"}
)

Starts the Emitter process. All options are required.

Options

  • :host
  • :port
  • :path
  • :secure
  • :client_id
  • :api_key

Types

event()
event() :: %Hivent.Event{meta: term, name: term, payload: term}

A Hivent Event struct

on_start()
on_start ::
  {:ok, pid} |
  :ignore |
  {:error, {:already_started, pid} | term}

Return values of start* functions

Functions

emit(name, payload, options)
emit(term, map, map) :: event

Emits the given event with name, payload and options

Options

  • :version
  • :cid optional
  • :key optional, will be derived from payload by default. It controls which partition the event is stored in.

Example

Emitter.emit(
  "my:event",
  %{foo: "bar"},
  %{version: 1, cid: "a_correlation_id"}
)
start_link(list)
start_link(map) :: on_start

Starts the Emitter process. All options are required.

Options

  • :host
  • :port
  • :path
  • :secure
  • :client_id
  • :api_key