ExEventBus.Publisher (ExEventBus v0.3.0)

View Source

Publishes events to the event bus.

Summary

Functions

Creates the job changesets used to publish the given event and its subscribers.

Publishes the events by enqueueing the ExEventBus.Worker jobs in the Oban queue. Takes the oban instance name and the job changesets as input. Returns the list of the enqueued Oban.Jobs.

Functions

create_job_changesets(subscribers, event, acc \\ [])

@spec create_job_changesets(
  subscribers :: [atom()],
  event :: ExEventBus.Event.t(),
  acc :: [Ecto.Changeset.t()]
) :: [Ecto.Changeset.t()]

Creates the job changesets used to publish the given event and its subscribers.

publish(oban_name, job_changesets, opts \\ [])

@spec publish(
  oban_name :: atom(),
  job_changesets :: [Ecto.Changeset.t()],
  opts :: Keyword.t()
) :: result :: [Oban.Job.t()] | Ecto.Multi.t()

Publishes the events by enqueueing the ExEventBus.Worker jobs in the Oban queue. Takes the oban instance name and the job changesets as input. Returns the list of the enqueued Oban.Jobs.