Skip to content

VitreousOptions class

Namespace: Vitreous
Assembly: Vitreous.dll

Configuration options for the Vitreous mediator.

public sealed class VitreousOptions

object ← VitreousOptions

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

Default service lifetime for registered handlers. Defaults to Scoped, which is safe for handlers that depend on scoped services such as a DbContext. ISender and IPublisher are then scoped too, so resolve them from a scope (minimal APIs and controllers do this automatically). Use Singleton only when every handler is stateless and has no scoped dependencies; the dispatcher is then a singleton as well.

public ServiceLifetime DefaultHandlerLifetime { get; set; }

ServiceLifetime

Controls how notification handlers are invoked when Publish<TNotification> is called. Defaults to Sequential (fail-fast, in-order). Set to Parallel to fan-out all handlers concurrently and collect all exceptions as an AggregateException.

public NotificationPublishStrategy NotificationPublishStrategy { get; set; }

NotificationPublishStrategy