Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

README.md

Eternal Orchestrations — Durable Task SDK (.NET)

.NET | Durable Task SDK

Description

Demonstrates eternal orchestrations using the Durable Task SDK. An orchestration that runs indefinitely by periodically performing work and restarting itself with ContinueAsNew, which clears its history to prevent unbounded growth.

This pattern is useful for:

  • Periodic data cleanup or aggregation
  • Heartbeat or health-check monitoring
  • Background jobs that run on a schedule
  • Any long-running loop that must survive restarts

Prerequisites

  1. .NET 8 SDK
  2. Docker (for the emulator)

Quick Run

  1. Start the Durable Task Scheduler emulator:

    docker run -d -p 8080:8080 -p 8082:8082 mcr.microsoft.com/dts/dts-emulator:latest
  2. Start the worker (in one terminal):

    cd Worker
    dotnet run
  3. Start the client (in another terminal):

    cd Client
    dotnet run
  4. View the eternal orchestration in the dashboard: http://localhost:8082

How It Works

  1. The orchestration performs a cleanup task (simulated)
  2. It logs the iteration count and result
  3. It waits using a durable timer (e.g., 10 seconds)
  4. It calls ContinueAsNew with an incremented counter, which restarts the orchestration with a clean history
  5. This loop continues indefinitely until explicitly terminated

Learn More