Skip to content

New overload for sub-saga invocation#99

Merged
VenyaBrodetskiy merged 2 commits intomasterfrom
venya/call-sub-saga-overload
Jan 15, 2025
Merged

New overload for sub-saga invocation#99
VenyaBrodetskiy merged 2 commits intomasterfrom
venya/call-sub-saga-overload

Conversation

@VenyaBrodetskiy
Copy link
Collaborator

Added a new CallSubSagaOptions record to encapsulate sub-saga invocation options. Updated DaprActorHost.cs with a new CallSubSagaAsync method and refactored the existing method to use CallSubSagaOptions. Modified MainSagaActor.cs to utilize the new CallSubSagaOptions record in sub-saga calls.

Added a new CallSubSagaOptions record to encapsulate sub-saga invocation options. Updated DaprActorHost.cs with a new CallSubSagaAsync method and refactored the existing method to use CallSubSagaOptions. Modified MainSagaActor.cs to utilize the new CallSubSagaOptions record in sub-saga calls.
@SubZeroX9 SubZeroX9 self-requested a review January 15, 2025 14:50
- Change `CallbackMethodName` in `CallSubSagaOptions` to required
- Initialize `CustomBindingMetadata` with an empty dictionary
- Mark `CallSubSagaAsync` overload as obsolete, recommend new overload
@VenyaBrodetskiy VenyaBrodetskiy merged commit cdacae7 into master Jan 15, 2025
1 check passed
@VenyaBrodetskiy VenyaBrodetskiy deleted the venya/call-sub-saga-overload branch January 15, 2025 18:42
: options.UseBindingName;

// Dispatch the sub-saga invocation with a single parameter (invocationContext)
await subSagaDaprClient.InvokeBindingAsync(
Copy link

Choose a reason for hiding this comment

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

maybe add try-catch and log for error or throw?

var callbackContext = CaptureCallbackContext(options.CallbackMethodName);

// Extract method name and parameters from the expression
var methodCall = (MethodCallExpression)methodExpression.Body;
Copy link

Choose a reason for hiding this comment

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

methodExpression.Body always have type MethodCallExpression?

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