async Task Execute(BehaviorContext <TInstance> context) { CompositeEventStatus value = _accessor.Get(context.Instance); value.Set(_flag); _accessor.Set(context.Instance, value); if (!value.Equals(_complete)) { return; } await RaiseCompositeEvent(context); }
void Execute(Composer composer, TInstance instance) { composer.Execute(() => { CompositeEventStatus value = _property.Get(instance); value.Set(_flag); _property.Set(instance, value); if (!value.Equals(_complete)) { return(composer.ComposeCompleted()); } var taskComposer = new TaskComposer <TInstance>(composer.CancellationToken); _completeCallback(taskComposer, instance); return(taskComposer.Finish()); }); }