Skip to content

Docs: fix WaitForExternalEvent references and add FIFO queue sample#1368

Open
cgillum wants to merge 6 commits into
mainfrom
docs/fix-waitforexternalevent
Open

Docs: fix WaitForExternalEvent references and add FIFO queue sample#1368
cgillum wants to merge 6 commits into
mainfrom
docs/fix-waitforexternalevent

Conversation

@cgillum

@cgillum cgillum commented Jun 15, 2026

Copy link
Copy Markdown
Member

The docs used a WaitForExternalEvent API that doesn't exist in DTFx. This updates the affected samples and API references across the docs to use the real OnEvent + TaskCompletionSource pattern.

While in here, I also added a FIFO job queue sample to the eternal orchestrations guide showing per-key serialization with ContinueAsNew.

Files touched:

  • docs/concepts/orchestrations.md
  • docs/concepts/deterministic-constraints.md
  • docs/features/eternal-orchestrations.md
  • docs/features/external-events.md (typed-event guidance and TrySetResult usage)
  • docs/features/timers.md
  • docs/getting-started/quickstart.md

DTFx has no WaitForExternalEvent helper. Update the docs samples and API references to use the real OnEvent + TaskCompletionSource pattern, and add a FIFO job queue sample to the eternal orchestrations guide.
Copilot AI review requested due to automatic review settings June 15, 2026 18:31

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates Durable Task Framework (DTFx) documentation to remove references to a non-existent WaitForExternalEvent API and replace those examples with the supported OnEvent + TaskCompletionSource external event pattern. It also adds a new FIFO-per-key job queue sample to the eternal orchestrations guide.

Changes:

  • Removed WaitForExternalEvent mentions from quickstart/determinism docs.
  • Rewrote multiple timer/orchestration samples to use OnEvent + TaskCompletionSource.
  • Added a FIFO queue sample showing per-key serialization using ContinueAsNew.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 9 comments.

Show a summary per file
File Description
docs/getting-started/quickstart.md Removes WaitForExternalEvent from the API list in the quickstart narrative.
docs/concepts/deterministic-constraints.md Removes WaitForExternalEvent from the “durable operations” list.
docs/concepts/orchestrations.md Updates external event and human-interaction examples to the OnEvent + TaskCompletionSource pattern.
docs/features/timers.md Updates timer + external-event samples and adds/adjusts guidance around cancellation patterns.
docs/features/eternal-orchestrations.md Updates event-driven eternal orchestration examples and adds a FIFO queue sample using ContinueAsNew.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread docs/features/timers.md
Comment thread docs/features/timers.md
Comment thread docs/features/eternal-orchestrations.md Outdated
Comment thread docs/features/eternal-orchestrations.md
Comment thread docs/features/eternal-orchestrations.md
Comment thread docs/concepts/orchestrations.md
Comment thread docs/concepts/orchestrations.md Outdated
Comment thread docs/concepts/orchestrations.md
Comment thread docs/features/eternal-orchestrations.md
Address Copilot review feedback on PR #1368. Use the 4-parameter TaskOrchestration<TResult,TInput,TEvent,TStatus> base so the framework deserializes event payloads and OnEvent receives a typed value (the prior string + manual MessageDataConverter.Deserialize pattern would throw for object payloads). Use TrySetResult instead of SetResult for idempotency against duplicate/late events, return default instead of null for generic results, and make the Cancel Unused Timers snippet self-contained.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 6 out of 6 changed files in this pull request and generated 5 comments.

Comment thread docs/features/timers.md Outdated
Comment thread docs/concepts/orchestrations.md Outdated
Comment thread docs/features/eternal-orchestrations.md Outdated
Comment thread docs/features/eternal-orchestrations.md
Comment thread docs/features/external-events.md
…payload

Address round 2 Copilot review feedback on PR #1368. Create the TaskCompletionSource before awaiting any activity so events raised while an activity runs are captured by OnEvent instead of dropped. Propagate the typed event value in the graceful-termination sample, and correct the MaxUpdatesPerGeneration comment to reflect that ContinueAsNew always runs each generation.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.

Comment thread docs/features/external-events.md

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.

ApprovalRequest request)
// The 4-type-parameter base declares bool as the event payload type, so the framework
// deserializes incoming events and passes OnEvent a typed value.
public class ApprovalOrchestration : TaskOrchestration<ApprovalResult, ApprovalRequest, bool, string>
nytian
nytian previously approved these changes Jun 24, 2026

@nytian nytian left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left two non-blocking comments. Thanks!

Comment thread docs/features/eternal-orchestrations.md
Comment thread docs/features/eternal-orchestrations.md
torosent
torosent previously approved these changes Jun 24, 2026
Copilot AI review requested due to automatic review settings June 24, 2026 03:53
@cgillum cgillum dismissed stale reviews from torosent and nytian via fe39b3a June 24, 2026 03:53

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 7 out of 7 changed files in this pull request and generated 5 comments.

Comment on lines +45 to +46
Each sample's full source is linked below. For deeper explanations of the patterns
they demonstrate, see the [DTFx documentation](../../docs/README.md).
Comment on lines +69 to +71
Schedules `CronTask` to run repeatedly on a [cron](https://en.wikipedia.org/wiki/Cron)
expression (via NCrontab), using `CreateTimer` to wait between runs. The parameter is the
cron schedule and is optional (it falls back to a fixed interval when omitted).
}
```
- Source: [Cron/CronOrchestration.cs](Cron/CronOrchestration.cs)
- Docs: [Timers](../../docs/features/timers.md), [Eternal Orchestrations](../../docs/features/eternal-orchestrations.md)
var approvalData = await context.WaitForExternalEvent<ApprovalData>("ApprovalReceived");
// The 4-type-parameter base declares ApprovalData as the event payload type, so the
// framework deserializes incoming events and passes OnEvent a typed value.
public class ApprovalOrchestration : TaskOrchestration<ApprovalData, string, ApprovalData, string>
Comment on lines +376 to +378
> [!NOTE]
> On Azure Storage (the default `Carryover` behavior), events that arrive during the brief `ContinueAsNew` transition are automatically re-delivered to the next generation, so nothing is lost. The Service Fabric provider instead uses `Ignore` and drops them — there, treat the producer as the source of truth and re-drive any unacknowledged update (using `UpdateId` for idempotency).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants