Table of Contents

Interface IWorkerRuntimeActor

Namespace
Virtufin.WorkManager.Shared.Actors
Assembly
Virtufin.WorkManager.dll

The Runtime's per-worker actor, called by the WorkManager (and by the Runtime itself to dispatch events). Every type a method passes must be in Virtufin.WorkManager.Shared.Actors.WorkerRuntimeActorJsonContext.

Not compiled into this project: the WorkManager and the Runtime each compile this file (a linked Compile item), because Dapr.Actors.Next's source generator emits proxies and dispatchers only for an actor interface in the compilation's own source.

[GenerateActorClient]
public interface IWorkerRuntimeActor : IActor

Methods

CreateAsync(CreateRuntimeWorkerPayload, CancellationToken)

Register the worker (status loading) without loading its code, so CreateWorker returns immediately.

Task CreateAsync(CreateRuntimeWorkerPayload body, CancellationToken cancellationToken = default)

Parameters

body CreateRuntimeWorkerPayload
cancellationToken CancellationToken

Returns

Task

DeleteAsync(CancellationToken)

Task DeleteAsync(CancellationToken cancellationToken = default)

Parameters

cancellationToken CancellationToken

Returns

Task

LoadAsync(CancellationToken)

Load the registered worker's code (fetch, dependency resolution, engine load). Idempotent; reports a load failure in the result instead of throwing.

Task<RuntimeLoadResult> LoadAsync(CancellationToken cancellationToken = default)

Parameters

cancellationToken CancellationToken

Returns

Task<RuntimeLoadResult>

LoadCodeAsync(LoadRuntimeCodePayload, CancellationToken)

Task LoadCodeAsync(LoadRuntimeCodePayload body, CancellationToken cancellationToken = default)

Parameters

body LoadRuntimeCodePayload
cancellationToken CancellationToken

Returns

Task

ProcessAsync(byte[], CancellationToken)

Process one event in the worker wire protocol: a protobuf CloudEvent in, a protobuf CloudEventBatch out (empty = no output), see Virtufin.Worker.Host.CloudEventProtoCodec.

Task<byte[]> ProcessAsync(byte[] cloudEvent, CancellationToken cancellationToken = default)

Parameters

cloudEvent byte[]
cancellationToken CancellationToken

Returns

Task<byte[]>

ReloadAsync(CancellationToken)

Re-fetch and reload the worker's code, re-resolving its library dependencies.

Task ReloadAsync(CancellationToken cancellationToken = default)

Parameters

cancellationToken CancellationToken

Returns

Task

StartAsync(CancellationToken)

Task StartAsync(CancellationToken cancellationToken = default)

Parameters

cancellationToken CancellationToken

Returns

Task

StopAsync(CancellationToken)

Task StopAsync(CancellationToken cancellationToken = default)

Parameters

cancellationToken CancellationToken

Returns

Task

TouchAsync(CancellationToken)

No-op; (re)activates the actor, whose activation self-heals the worker.

Task TouchAsync(CancellationToken cancellationToken = default)

Parameters

cancellationToken CancellationToken

Returns

Task