Skip to content

WebhookPublisher

Namespace AgentPrism · Assembly AgentPrism.Core.dll

Publishes an event to its matching subscriptions. It creates the delivery record and writes the delivery to the job queue.

public sealed class WebhookPublisher : IWebhookPublisher

objectWebhookPublisher

IWebhookPublisher

object.GetType(), object.ToString(), object.Equals(object?), object.Equals(object?, object?), object.ReferenceEquals(object?, object?), object.GetHashCode()

Delivery does not occur inside the request. A slow or unavailable recipient must not slow the main run path, so publishing writes only two rows, the delivery record and queue job, then returns.

The observability rule applies. If publishing fails, the caller is unaffected, the error is logged, and the method returns 0.

WebhookPublisher(IWebhookStore, IJobStore, IOptionsMonitor<AgentPrismWebhookOptions>, TimeProvider?, ILogger<WebhookPublisher>?)

Section titled “ WebhookPublisher(IWebhookStore, IJobStore, IOptionsMonitor<AgentPrismWebhookOptions>, TimeProvider?, ILogger<WebhookPublisher>?)”

Publishes an event to its matching subscriptions. It creates the delivery record and writes the delivery to the job queue.

public WebhookPublisher(IWebhookStore store, IJobStore jobStore, IOptionsMonitor<AgentPrismWebhookOptions> optionsMonitor, TimeProvider? timeProvider = null, ILogger<WebhookPublisher>? logger = null)

store IWebhookStore

jobStore IJobStore

optionsMonitor IOptionsMonitor<AgentPrismWebhookOptions>

timeProvider TimeProvider?

logger ILogger<WebhookPublisher>?

Delivery does not occur inside the request. A slow or unavailable recipient must not slow the main run path, so publishing writes only two rows, the delivery record and queue job, then returns.

The observability rule applies. If publishing fails, the caller is unaffected, the error is logged, and the method returns 0.

PublishAsync(string, string, WebhookEventPayload, CancellationToken)

Section titled “ PublishAsync(string, string, WebhookEventPayload, CancellationToken)”

Writes an event to the queue.

public ValueTask<int> PublishAsync(string tenantId, string eventType, WebhookEventPayload payload, CancellationToken cancellationToken = default)

tenantId string

The tenant identifier.

eventType string

The event name. See WebhookEvents.

payload WebhookEventPayload

The event summary. Serialized and written to the body.

cancellationToken CancellationToken

The cancellation token.

ValueTask<int>

The number of deliveries created. 0 if there is no subscriber.