WebhookPublisher
AgentPrism.Core.dllPublishes an event to its matching subscriptions. It creates the delivery record and writes the delivery to the job queue.
public sealed class WebhookPublisher : IWebhookPublisherInheritance
Section titled “Inheritance”Implements
Section titled “Implements”Inherited Members
Section titled “Inherited Members”object.GetType(), object.ToString(), object.Equals(object?), object.Equals(object?, object?), object.ReferenceEquals(object?, object?), object.GetHashCode()
Remarks
Section titled “Remarks”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.
Constructors
Section titled “Constructors”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)Parameters
Section titled “Parameters”store IWebhookStore
jobStore IJobStore
optionsMonitor IOptionsMonitor<AgentPrismWebhookOptions>
timeProvider TimeProvider?
logger ILogger<WebhookPublisher>?
Remarks
Section titled “Remarks”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.
Methods
Section titled “Methods”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)Parameters
Section titled “Parameters”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.
Returns
Section titled “Returns”The number of deliveries created. 0 if there is no subscriber.