Class PubsubSubscriptionOptions
How long a topic's Dapr subscription stays open after its last subscriber left
(configuration PubsubSubscriptionLingerSeconds, default
DefaultLingerSeconds, 0 closes at once). A subscriber that joins
meanwhile reuses it, so a quick resubscribe never closes and reopens a Dapr
subscription: a closed one leaves daprd's reader behind to take the topic's next
message (common#28). Messages published while nobody is subscribed are acked and
dropped, as with no subscription at all (no catch-up).
public sealed record PubsubSubscriptionOptions : IEquatable<PubsubSubscriptionOptions>
- Inheritance
-
PubsubSubscriptionOptions
- Implements
- Inherited Members
Constructors
PubsubSubscriptionOptions(TimeSpan)
How long a topic's Dapr subscription stays open after its last subscriber left
(configuration PubsubSubscriptionLingerSeconds, default
DefaultLingerSeconds, 0 closes at once). A subscriber that joins
meanwhile reuses it, so a quick resubscribe never closes and reopens a Dapr
subscription: a closed one leaves daprd's reader behind to take the topic's next
message (common#28). Messages published while nobody is subscribed are acked and
dropped, as with no subscription at all (no catch-up).
public PubsubSubscriptionOptions(TimeSpan Linger)
Parameters
LingerTimeSpan
Fields
DefaultLingerSeconds
public const int DefaultLingerSeconds = 10
Field Value
Immediate
No linger: the subscription closes with its last subscriber.
public static readonly PubsubSubscriptionOptions Immediate
Field Value
Properties
Linger
public TimeSpan Linger { get; init; }
Property Value
Methods
From(string?)
From configuration; unset or unparsable keeps the default, a negative value is 0.
public static PubsubSubscriptionOptions From(string? lingerSeconds)
Parameters
lingerSecondsstring