Add CreateCallbackAsync and WaitForCallbackAsync (DOTNET-8660)#2373
Draft
GarrettBeatty wants to merge 1 commit into
Draft
Add CreateCallbackAsync and WaitForCallbackAsync (DOTNET-8660)#2373GarrettBeatty wants to merge 1 commit into
GarrettBeatty wants to merge 1 commit into
Conversation
|
|
||
| COPY bin/publish/ ${LAMBDA_TASK_ROOT} | ||
|
|
||
| ENTRYPOINT ["/var/task/bootstrap"] |
|
|
||
| COPY bin/publish/ ${LAMBDA_TASK_ROOT} | ||
|
|
||
| ENTRYPOINT ["/var/task/bootstrap"] |
|
|
||
| COPY bin/publish/ ${LAMBDA_TASK_ROOT} | ||
|
|
||
| ENTRYPOINT ["/var/task/bootstrap"] |
|
|
||
| COPY bin/publish/ ${LAMBDA_TASK_ROOT} | ||
|
|
||
| ENTRYPOINT ["/var/task/bootstrap"] |
|
|
||
| COPY bin/publish/ ${LAMBDA_TASK_ROOT} | ||
|
|
||
| ENTRYPOINT ["/var/task/bootstrap"] |
464c591 to
d308c3b
Compare
503666b to
951fcd1
Compare
Adds callback support to the .NET Durable Execution SDK. CreateCallbackAsync returns an ICallback<T> handle (CallbackId + GetResultAsync) that suspends the workflow until an external system delivers a result via the durable execution service. WaitForCallbackAsync composes CreateCallback + a submitter step + GetResultAsync inside a child context for the common "submit and wait" pattern. Public surface: - IDurableContext.CreateCallbackAsync<T> (reflection + AOT-safe overloads) - IDurableContext.WaitForCallbackAsync<T> (reflection + AOT-safe overloads) - ICallback<T> with CallbackId and GetResultAsync - IWaitForCallbackContext (Logger only) for submitter functions - CallbackConfig (Timeout + HeartbeatTimeout, validates sub-second values) - WaitForCallbackConfig : CallbackConfig adds RetryStrategy - Exception subclass tree: CallbackException base + CallbackFailedException, CallbackTimeoutException, CallbackSubmitterException Internal: - CallbackOperation<T> handles fresh execution sync-flush of START with service-allocated CallbackId, deferred error propagation, and replay for SUCCEEDED/FAILED/TIMED_OUT/STARTED/PENDING. Unknown statuses throw NonDeterministicExecutionException. - LambdaDurableServiceClient gains an onNewOperations callback so the freshly-allocated CallbackId from NewExecutionState flows back into ExecutionState during the START flush. - WaitForCallback's error mapping preserves subclass fidelity on parent-CONTEXT-FAILED replay (CallbackTimeoutException remains CallbackTimeoutException, etc.). Adds 43 unit tests + 5 integration tests covering happy path, timeout, failure, submitter failure, replay determinism, and replay of each exception subtype. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
951fcd1 to
1c88461
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds callback support to the .NET Durable Execution SDK:
CreateCallbackAsync<T>returns anICallback<T>handle that suspends the workflow until an external system delivers a result via the durable execution service.WaitForCallbackAsync<T>composes CreateCallback + a submitter step + GetResultAsync inside a child context for the common "submit and wait" pattern.Stacked on top of #2372 (Wave 0 cross-cutting types).
Fixes DOTNET-8660.
Public surface
IDurableContext.CreateCallbackAsync<T>(reflection + AOT-safe overloads)IDurableContext.WaitForCallbackAsync<T>(reflection + AOT-safe overloads)ICallback<T>withCallbackIdandGetResultAsyncIWaitForCallbackContext(Logger only) for submitter functionsCallbackConfig(Timeout + HeartbeatTimeout, validates sub-second values)WaitForCallbackConfig : CallbackConfigaddsRetryStrategyCallbackExceptionbase +CallbackFailedException,CallbackTimeoutException,CallbackSubmitterExceptionInternal
CallbackOperation<T>handles fresh execution sync-flush of START with service-allocatedCallbackId, deferred error propagation, and replay for SUCCEEDED / FAILED / TIMED_OUT / STARTED / PENDING. Unknown statuses throwNonDeterministicExecutionException.LambdaDurableServiceClientgains anonNewOperationscallback so the freshly-allocatedCallbackIdfromNewExecutionStateflows back intoExecutionStateduring the START flush.WaitForCallback's error mapping preserves subclass fidelity on parent-CONTEXT-FAILED replay (CallbackTimeoutExceptionremainsCallbackTimeoutException, etc.).Test plan
🤖 Generated with Claude Code