Skip to content

IWebhookPublisher

Namespace AgentPrism · Assembly AgentPrism.Abstractions.dll

The component that publishes an event to its subscriptions.

public interface IWebhookPublisher

Core code calls this; delivery does not happen in the request, it is written to a queue. This way a slow or unreachable recipient does not slow down the main path.

The observability rule applies here too: if publishing fails, the run continues, the error is only logged.

PublishAsync(string, string, WebhookEventPayload, CancellationToken)

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

Writes an event to the queue.

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.