protected override void Execute(NativeActivityContext context)
 {
     SendRequestReceiveResponseScopeExecutionProperty executionProperty = context.GetSendRequestReceiveResponseScopeExecutionProperty();
     if (executionProperty.UntypedOnOperationTask != null)
     {
         // We await the task, but we won't execute the task's Func<Task> or Func<Task<TResponseResult>> return value, that is the ReceiveResponse activity's responsibility.
         context.ScheduleAction(responseResultWaiter, executionProperty.UntypedOnOperationTask);
         executionProperty.OnOperationTaskWaiterIsScheduled();
     }       
 }
            protected override void Execute(NativeActivityContext context)
            {
                SendRequestReceiveResponseScopeExecutionProperty executionProperty = context.GetSendRequestReceiveResponseScopeExecutionProperty();

                if (executionProperty.UntypedOnOperationTask != null)
                {
                    // We await the task, but we won't execute the task's Func<Task> or Func<Task<TResponseResult>> return value, that is the ReceiveResponse activity's responsibility.
                    context.ScheduleAction(responseResultWaiter, executionProperty.UntypedOnOperationTask);
                    executionProperty.OnOperationTaskWaiterIsScheduled();
                }
            }
Пример #3
0
        // This will start/schedule the OnOperationAsync task, but won't wait for it, the task will be an implicit (single threaded reentrant) parallel activity.
        // The Scope is responsible to handle the outstanding task in case of Abort, Cancellation or Termination.
        protected override void Execute(NativeActivityContext context)
        {
            SendRequestReceiveResponseScopeExecutionProperty executionProperty = context.GetSendRequestReceiveResponseScopeExecutionProperty();
            IActivityContext activityContext = context.GetActivityContext();

            executionProperty.StartOnOperationAsync(activityContext, OperationName);

            if (activityContext.TrackingEnabled)
            {
                context.Track(new SendRequestRecord(OperationName));
            }
        }