Class PublishingResult
Represents the result of an outbox publishing operation.
public sealed class PublishingResult
- Inheritance
-
PublishingResult
- Inherited Members
- Extension Methods
Properties
Duration
Gets the duration of the publishing operation.
public TimeSpan Duration { get; init; }
Property Value
Errors
Gets any errors that occurred during publishing.
public IReadOnlyList<PublishingError> Errors { get; init; }
Property Value
FailureCount
Gets the number of messages that failed to publish.
public int FailureCount { get; init; }
Property Value
- int
The current FailureCount value.
IsSuccess
Gets a value indicating whether the operation was successful.
public bool IsSuccess { get; }
Property Value
IsTenureRefused
Gets whether admission or continuation was refused for the drain's captured leadership tenure.
public bool IsTenureRefused { get; }
Property Value
Remarks
Transport effects may already have occurred. Counts describe actual row outcomes, not the refusal; the row success rate can be 100 percent while the operation verdict is refused. Unattempted rows are not delivery failures. Existing success/failure factories leave this flag false.
Outcome
Gets the operation outcome, independently of actual row counters.
public PublishingOutcome Outcome { get; init; }
Property Value
Remarks
The default is Completed, including existing factory results and ordinary partial fanout results. TenureRefused dominates Interrupted when both occur; unknown values never imply success. Interrupted may follow real transport effects and does not fabricate a failed row.
SkippedCount
Gets the number of messages that were skipped (e.g., not ready for delivery).
public int SkippedCount { get; init; }
Property Value
- int
The current SkippedCount value.
SuccessCount
Gets the number of accepted message publications (or accepted deliveries for a per-transport drain).
public int SuccessCount { get; init; }
Property Value
- int
The current SuccessCount value.
Remarks
A single-transport acceptance remains counted if its durable mark is refused. A fanout row is counted once when any admitted delivery succeeds; its transport counts are not added as rows. This count alone does not establish durable completion or a fully drained batch.
SuccessRate
Gets the success rate as a percentage.
public double SuccessRate { get; }
Property Value
- double
The current SuccessRate value.
Timestamp
Gets the timestamp when this result was created.
public DateTimeOffset Timestamp { get; init; }
Property Value
- DateTimeOffset
The current Timestamp value.
TotalProcessed
Gets the total number of messages processed.
public int TotalProcessed { get; }
Property Value
- int
The current TotalProcessed value.
Methods
Success(int, int, TimeSpan)
Creates a successful publishing result.
public static PublishingResult Success(int successCount, int skippedCount = 0, TimeSpan duration = default)
Parameters
successCountintNumber of messages successfully published.
skippedCountintNumber of messages skipped.
durationTimeSpanDuration of the operation.
Returns
- PublishingResult
A successful publishing result.
ToString()
Returns a string that represents the current object.
public override string ToString()
Returns
- string
A string that represents the current object.
WithFailures(int, int, IEnumerable<PublishingError>, TimeSpan)
Creates a failed publishing result.
public static PublishingResult WithFailures(int successCount, int failureCount, IEnumerable<PublishingError> errors, TimeSpan duration = default)
Parameters
successCountintNumber of messages successfully published.
failureCountintNumber of messages that failed to publish.
errorsIEnumerable<PublishingError>Errors that occurred during publishing.
durationTimeSpanDuration of the operation.
Returns
- PublishingResult
A failed publishing result.