Class DeliveryPolicy<T>
Encapsulates the options for message delivery behavior.
Namespace: Microsoft.Psi
Assembly: Microsoft.Psi.dll
Syntax
public class DeliveryPolicy<T> : object
Type Parameters
Name | Description |
---|---|
T | The type of messages. |
Properties
View SourceAttemptSynchronousDelivery
Gets a value indicating whether the runtime should attempt synchronous delivery when possible.
Declaration
public bool AttemptSynchronousDelivery { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
GuaranteeDelivery
Gets a function that indicates for which messages the delivery should be guaranteed.
Declaration
public Func<T, bool> GuaranteeDelivery { get; }
Property Value
Type | Description |
---|---|
Func<T, System.Boolean> |
InitialQueueSize
Gets the initial size of the receiver queue that holds the messages pending delivery.
Declaration
public int InitialQueueSize { get; }
Property Value
Type | Description |
---|---|
System.Int32 |
MaximumLatency
Gets the maximum latency of items to be delivered. Items with a latency larger than this are discarded.
Declaration
public TimeSpan? MaximumLatency { get; }
Property Value
Type | Description |
---|---|
System.Nullable<TimeSpan> |
MaximumQueueSize
Gets the maximum size of the receiver queue that holds the messages pending delivery.
Declaration
public int MaximumQueueSize { get; }
Property Value
Type | Description |
---|---|
System.Int32 |
Name
Gets name used for debugging and diagnostics.
Declaration
public string Name { get; }
Property Value
Type | Description |
---|---|
String |
ThrottleQueueSize
Gets the number of messages in the receiver queue at and above which the upstream producer will be blocked.
Declaration
public int? ThrottleQueueSize { get; }
Property Value
Type | Description |
---|---|
System.Nullable<System.Int32> |
Remarks
Use with care, as it affects all other subscribers to the same producer and can introduce deadlocks (a blocked producer cannot process control messages anymore).
Methods
View SourceWithGuarantees(Func<T, Boolean>)
Creates a delivery policy with guarantees by adding a message guaranteed function to an existing delivery policy.
Declaration
public DeliveryPolicy<T> WithGuarantees(Func<T, bool> guaranteeDelivery)
Parameters
Type | Name | Description |
---|---|---|
Func<T, System.Boolean> | guaranteeDelivery | A function that evaluates whether the delivery of a given message should be guaranteed. |
Returns
Type | Description |
---|---|
DeliveryPolicy<T> | The typed delivery policy with guarantees. |
Operators
View SourceImplicit(DeliveryPolicy to DeliveryPolicy<T>)
Implicitly cast from an untyped to a typed delivery policy.
Declaration
public static implicit operator DeliveryPolicy<T>(DeliveryPolicy policy)
Parameters
Type | Name | Description |
---|---|---|
DeliveryPolicy | policy | The untyped delivery policy. |
Returns
Type | Description |
---|---|
DeliveryPolicy<T> |
Implicit(DeliveryPolicySpec to DeliveryPolicy<T>)
Implicit cast operator from DeliveryPolicySpec to DeliveryPolicy<T>.
Declaration
public static implicit operator DeliveryPolicy<T>(DeliveryPolicySpec deliveryPolicySpec)
Parameters
Type | Name | Description |
---|---|---|
DeliveryPolicySpec | deliveryPolicySpec | The delivery policy specification. |
Returns
Type | Description |
---|---|
DeliveryPolicy<T> |