RunicInteractionTimeoutAttribute class

Namespace Runic.Application.Views in Runic.Application.Views 0.23.0

public sealed class RunicInteractionTimeoutAttribute : Attribute

Inherits or implements Attribute.

Sets how long a page may take to answer a ReactiveUI Interaction that a Bridge exposes, or that it has no deadline.

Parameters

milliseconds

How long a page may take to answer, in milliseconds, from 1 to RunicInteractionTimeoutAttribute.MaximumMilliseconds (24 hours), or Timeout.Infinite for no deadline.

Remarks

Without it, a page has two minutes. When the time passes, the page's handler is aborted (its signal) and Interaction.Handle throws RunicInteractionTimeoutException. Use Timeout.Infinite for a question a person answers, such as a modal confirmation: the question still ends when the asking command is cancelled, when its page unmounts or disconnects and when the Window closes, and then Handle throws RunicInteractionCancelledException.

[RunicInteractionTimeout(Timeout.Infinite)]
public Interaction<ConfirmationRequest, bool> ConfirmAction { get; } = new();

[RunicInteractionTimeout(15 * 60 * 1000)] // fifteen minutes
public Interaction<RenameRequest, string?> Rename { get; } = new();

It applies to the property of a ReactiveUI Interaction (IInteraction<TInput, TOutput>). On a ViewQuestion the Bridge generator reports RUNICBRIDGE074, because a view question takes its timeout in its constructor; on another member it has no effect. A value that is neither Timeout.Infinite nor between 1 and RunicInteractionTimeoutAttribute.MaximumMilliseconds is reported as RUNICBRIDGE073. The lifetime is .NET-side only: the generated TypeScript and contract hash do not change.

A page of @runic-artifex/views before 0.23 still aborts its handler after ten minutes, so with such a page a longer question ends then with RunicInteractionCancelledException.

Constructors

RunicInteractionTimeoutAttribute

public RunicInteractionTimeoutAttribute(int milliseconds)

Sets how long a page may take to answer a ReactiveUI Interaction that a Bridge exposes, or that it has no deadline.

Parameters

milliseconds

How long a page may take to answer, in milliseconds, from 1 to RunicInteractionTimeoutAttribute.MaximumMilliseconds (24 hours), or Timeout.Infinite for no deadline.

Remarks

Without it, a page has two minutes. When the time passes, the page's handler is aborted (its signal) and Interaction.Handle throws RunicInteractionTimeoutException. Use Timeout.Infinite for a question a person answers, such as a modal confirmation: the question still ends when the asking command is cancelled, when its page unmounts or disconnects and when the Window closes, and then Handle throws RunicInteractionCancelledException.

[RunicInteractionTimeout(Timeout.Infinite)]
public Interaction<ConfirmationRequest, bool> ConfirmAction { get; } = new();

[RunicInteractionTimeout(15 * 60 * 1000)] // fifteen minutes
public Interaction<RenameRequest, string?> Rename { get; } = new();

It applies to the property of a ReactiveUI Interaction (IInteraction<TInput, TOutput>). On a ViewQuestion the Bridge generator reports RUNICBRIDGE074, because a view question takes its timeout in its constructor; on another member it has no effect. A value that is neither Timeout.Infinite nor between 1 and RunicInteractionTimeoutAttribute.MaximumMilliseconds is reported as RUNICBRIDGE073. The lifetime is .NET-side only: the generated TypeScript and contract hash do not change.

A page of @runic-artifex/views before 0.23 still aborts its handler after ten minutes, so with such a page a longer question ends then with RunicInteractionCancelledException.

Fields

MaximumMilliseconds

public const int MaximumMilliseconds = 86400000

The longest finite timeout, in milliseconds: 24 hours.

Properties

Milliseconds

public int Milliseconds { get; }

Gets the timeout in milliseconds, or Timeout.Infinite for none.

Timeout

public TimeSpan Timeout { get; }

Gets the timeout, Timeout.InfiniteTimeSpan for none, as ReactiveInteractionDescriptor.Create and ViewQuestion take it.