Table of Contents

Struct Awakeable<T>

Namespace
Restate.Sdk
Assembly
Restate.Sdk.dll
public readonly record struct Awakeable<T> : IDurableFuture<T>, IDurableFuture, IEquatable<Awakeable<T>>

Type Parameters

T
Implements
Inherited Members

Properties

Future

The durable future that settles when the awakeable is resolved or rejected. The payload is deserialized on the first await of it or of Value, not when the runtime delivers it.

public required IDurableFuture<T> Future { get; init; }

Property Value

IDurableFuture<T>

Id

The unique identifier for this awakeable. Pass this to an external system so it can resolve the awakeable when ready.

public required string Id { get; init; }

Property Value

string

InvocationId

The invocation id of the invocation this future started, or null.

Non-null only on a future returned by a call operation — CallFuture or a future-returning typed client method — and only once the server has delivered the id. Reading never blocks, so it is null between starting the call and the notification arriving; awaiting the future is enough to make the id available.

Always null for futures that start no invocation: timers, side effects (RunAsync), awakeables and signals. One-way sends do not return a future; they hand back an InvocationHandle that always carries the id.

public string? InvocationId { get; }

Property Value

string

Remarks

Always null: an awakeable starts no invocation.

Value

The value that will be available once the awakeable is resolved.

public required ValueTask<T> Value { get; init; }

Property Value

ValueTask<T>

Remarks

This value must only be awaited once.

Methods

GetResult()

Awaits the awakeable's value, forwarding to Future. Safe to await more than once: every await observes the same outcome and the same decoded value.

public ValueTask<T> GetResult()

Returns

ValueTask<T>