AppSurface Search
API Reference

Work

Type

SampleWorkExecutor

Source

Executes the deterministic sample without performing an external side effect.

Type

SampleWork

Source

Input persisted by the starter's application-owned typed Work contract.

Parameters

  • Value
    A nonblank value of at most 200 characters.
Type

SampleWorkResult

Source

Deterministic result stored when the sample executor reaches a successful terminal state.

Parameters

  • Value
    The bounded processed value.
Type

SampleWorkJsonContext

Source

Source-generated JSON metadata used by the durable input and result codecs.

Type

SampleWorkDefinition

Source

Defines the immutable name, version, codecs, safety classification, and retry policy for the sample Work.

Method

CreateWorkCodec

SystemTextJsonDurablePayloadCodec<SampleWork> CreateWorkCodec()

Creates the bounded, source-generated JSON input codec used by this contract.

Returns

A codec with the stable sample input identity and a 1 KiB encoded-payload limit.

Method

CreateResultCodec

SystemTextJsonDurablePayloadCodec<SampleWorkResult> CreateResultCodec()

Creates the bounded, source-generated JSON result codec used by this contract.

Returns

A codec with the stable sample result identity and a 1 KiB encoded-payload limit.

Property

Definition

DurableWorkDefinition<SampleWork, SampleWorkResult> Definition { get; } Source

Gets the one definition shared by registration and request construction.

Type

SampleWorkProducer

Source

Accepts typed sample Work through the public Durable client without coupling producers to activation HTTP.

Method

AcceptAsync

ValueTask<DurableOperationResult<DurableWorkAcceptance>> AcceptAsync(SampleWork work, DurableCommandId commandId, string idempotencyKey, CancellationToken cancellationToken = default)

Persists one caller-identified sample request.

Parameters

  • work
    Validated typed input.
  • commandId
    Stable command identity for the logical caller operation.
  • idempotencyKey
    Caller-owned duplicate-submission key; reuse it only for a retry of the same intent.
  • cancellationToken
    Cancels the persistence request.

Returns

The provider's typed acceptance result; acceptance does not mean the Work reached a terminal state.

Remarks

The producer uses the one registered definition, its captured codecs and retry policy, and the fixed sample scope. Activation remains a separate payload-free HTTP wake. The application owns command identity and idempotency-key lifetime; changing either on retry can create a distinct durable request.

Type

WorkRegistration

Source

Registers the single sample Work contract and executor with an application service collection.

Method

AddSampleWork

IServiceCollection AddSampleWork(this IServiceCollection services)

Adds the sample definition and its deterministic executor.

Parameters

  • services
    Application service collection to configure.

Returns

The same service collection for further application composition.

Exceptions

  • ArgumentNullException
    services is null.