ArchAstro.SDK.V1.EventSubscriptions (archastro v0.3.5)

Copy Markdown

EventSubscription API resource.

Summary

Functions

Claim events from a subscription

Create a domain-event subscription

Delete a domain-event subscription

Get a domain-event subscription

Peek at the head of a subscription queue

Update a domain-event subscription

Functions

claim(client, subscription, input)

Claim events from a subscription

Atomically leases the oldest unacknowledged delivery. Returns an empty data array when the queue is empty or its head already has an active lease. Passing max_events opts into batch mode, where leased entries are skipped instead of blocking; wait_seconds bounds a long poll on an empty queue.

Successful response

create(client, input)

Create a domain-event subscription

Creates a durable subscription that receives exportable domain events matching its exact event names. Matching events fan out into a per-subscription queue bounded by max_pending_events and retention_seconds; consume with claim and acknowledge.

The new volatile subscription.

delete(client, subscription)

@spec delete(ArchAstro.SDK.Client.t(), String.t()) ::
  {:ok, :ok} | {:error, ArchAstro.SDK.Error.reason()}

Delete a domain-event subscription

Deletes the subscription and every delivery still in its queue.

No content

get(client, subscription)

Get a domain-event subscription

Returns one subscription and its current queue counters.

Successful response

head(client, subscription)

Peek at the head of a subscription queue

Returns the oldest unacknowledged delivery without reserving it. This diagnostic read cannot be used as a safe substitute for claim.

Successful response

list(client, params \\ %ArchAstro.SDK.Types.Operations.GetApiV1EventSubscriptions.Params{})

List domain-event subscriptions

Lists the subscriptions visible to the caller, with current queue counters.

Subscriptions visible to this caller.

queue(client, subscription, params \\ %ArchAstro.SDK.Types.Operations.GetApiV1EventSubscriptionsSubscriptionQueue.Params{})

Read a subscription queue

Returns a non-reserving, oldest-first view of unacknowledged deliveries, including the queue's loss indicators (queue_epoch, dropped_events_total, dropped_through_position). Use claim to obtain a receipt handle before acknowledging.

Successful response

update(client, subscription, input)

Update a domain-event subscription

Updates matching, status, or queue limits for future fanout. Already queued deliveries remain unless a lower cap trims the oldest entries; retention changes apply to future deliveries only.

Successful response