Skip to content

Legacy: Resilience Example

Resilience example for the original grain handle API.

Applying the current resilience helpers to an original-API grain handle.

The resilience library itself is current. Only this handle example belongs to the legacy authoring model. New actors use grainContract, grainFor, and FunctionalGrain.ref.

let! price =
GrainResilience.retry<decimal> 3 TimeSpan.Zero (fun () ->
FSharpGrain.ask<PricingState, PricingCommand, decimal> (GetPrice itemId) pricingGrain)

For functional API records, pass the record-field call directly to GrainResilience.execute; see Grain Resilience.