Skip to content

TimeProviderNames

class

Namespace: Orleans.Runtime

Service keys used to resolve per-area System.TimeProvider instances from dependency injection for the areas owned by the Orleans core runtime. Individual extension packages (reminders, streaming, transactions, durable jobs, journaling, and similar) define their own keys in the corresponding package.
public static class TimeProviderNames

Remarks

Orleans resolves time from a single default System.TimeProvider registration. To allow individual subsystems to be driven by different clocks, each area also resolves a keyedSystem.TimeProvider using one of these keys. A catch-all Microsoft.Extensions.DependencyInjection.KeyedService.AnyKey registration resolves every key to the unkeyed default provider, so behavior is unchanged unless a specific area is overridden.

This is primarily useful for testing: a test can install a controllable clock (such as Microsoft.Extensions.Time.Testing.FakeTimeProvider) as the default provider to drive grain timers and grain-facing delays deterministically, while pinning the silo''s background maintenance timers to real time so that advancing the fake clock does not resume those loops inline.

Fields

  • ActivationManagement The clock used by activation lifecycle management, including activation collection, migratability checks, repartitioning, and rebalancing.
  • GrainDirectory The clock used by the grain directory cache for entry expiration.
  • Grains The clock exposed to grains via IGrainRuntime.TimeProvider and used to drive grain timers.
  • Membership The clock used by cluster membership loops, including the membership agent, membership table maintenance and cleanup, and silo health monitoring and probing.
  • Messaging The clock used by messaging infrastructure, such as request timeout tracking and gateway maintenance.
  • SystemTimers The clock used by silo background maintenance loops driven by IAsyncTimerFactory (grain directory maintenance and similar), excluding cluster membership, which uses TimeProviderNames.