Documentation
Table of Contents

Method StartAsync

Namespace
IntentSharp.Trials
Assembly
IntentSharp.dll

StartAsync(IntentTrial, CancellationToken)

Starts running trial's candidate side by side with the running version of its document. With a document store, the trial continues from the counts its state holds for the same document and version.

public ValueTask StartAsync(IntentTrial trial, CancellationToken ct = default)

Parameters

trial IntentTrial

The document, the candidate version and how often to sample.

ct CancellationToken

Cancels reading the counts from the store; the trial is then not started.

Returns

ValueTask

Remarks

The trial runs, and counts calls, from when this returns. The counts are read from the store first: a read that fails, whatever it throws, is logged at Debug and the trial counts from zero, since the counts are advisory. The candidate version is not read here: a version that is not in the store, or does not load, counts as CandidateUnavailable or CandidateFailed on each sampled call, while the running version keeps answering.

Exceptions

ArgumentNullException

trial is null.

ArgumentException

trial names no document.

ArgumentOutOfRangeException

The trial's Sequence or SampleEvery is below 1.

InvalidOperationException

A trial of the same document is already running; stop it first.