LemonChannels.Outbox (lemon_channels v0.1.0)

View Source

Outbox for queuing and delivering outbound messages.

The outbox provides:

  • Queued delivery with retry
  • Idempotency checking
  • Rate limiting
  • Automatic chunking for long messages
  • Telemetry emission

Summary

Functions

Returns a specification to start this module under a supervisor.

Enqueue a payload for delivery.

Returns current outbox statistics.

Functions

child_spec(init_arg)

Returns a specification to start this module under a supervisor.

See Supervisor.

enqueue(payload)

@spec enqueue(LemonChannels.OutboundPayload.t()) ::
  {:ok, reference()} | {:error, term()}

Enqueue a payload for delivery.

If the content exceeds the channel's chunk limit, it will be automatically split into multiple messages.

Returns {:ok, ref} or {:error, reason}.

start_link(opts \\ [])

stats()

@spec stats() :: map()

Returns current outbox statistics.