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
List domain-event subscriptions
Read a subscription queue
Update a domain-event subscription
Functions
@spec claim( ArchAstro.SDK.Client.t(), String.t(), ArchAstro.SDK.Types.Operations.PostApiV1EventSubscriptionsSubscriptionClaim.Input.t() ) :: {:ok, ArchAstro.SDK.Types.EventSubscriptionClaim.t()} | {:error, ArchAstro.SDK.Error.reason()}
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
@spec create( ArchAstro.SDK.Client.t(), ArchAstro.SDK.Types.Operations.PostApiV1EventSubscriptions.Input.t() ) :: {:ok, ArchAstro.SDK.Types.EventSubscription.t()} | {:error, ArchAstro.SDK.Error.reason()}
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.
@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
@spec get(ArchAstro.SDK.Client.t(), String.t()) :: {:ok, ArchAstro.SDK.Types.EventSubscription.t()} | {:error, ArchAstro.SDK.Error.reason()}
Get a domain-event subscription
Returns one subscription and its current queue counters.
Successful response
@spec head(ArchAstro.SDK.Client.t(), String.t()) :: {:ok, ArchAstro.SDK.Types.EventSubscriptionHead.t()} | {:error, ArchAstro.SDK.Error.reason()}
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
@spec list( ArchAstro.SDK.Client.t(), ArchAstro.SDK.Types.Operations.GetApiV1EventSubscriptions.Params.t() ) :: {:ok, ArchAstro.SDK.Types.EventSubscriptionPage.t()} | {:error, ArchAstro.SDK.Error.reason()}
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{})
@spec queue( ArchAstro.SDK.Client.t(), String.t(), ArchAstro.SDK.Types.Operations.GetApiV1EventSubscriptionsSubscriptionQueue.Params.t() ) :: {:ok, ArchAstro.SDK.Types.EventSubscriptionQueue.t()} | {:error, ArchAstro.SDK.Error.reason()}
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
@spec update( ArchAstro.SDK.Client.t(), String.t(), ArchAstro.SDK.Types.Operations.PatchApiV1EventSubscriptionsSubscription.Input.t() ) :: {:ok, ArchAstro.SDK.Types.EventSubscription.t()} | {:error, ArchAstro.SDK.Error.reason()}
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