Skip to content

[NEW]mgmt resources, sync implementation for TaskGroup #45139

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

### Features Added

- Supported `invoke` and `invoke(ctx)` in `TaskGroup`.

### Breaking Changes

### Bugs Fixed
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ public class DAGraph<DataT, NodeT extends DAGNode<DataT, NodeT>> extends Graph<D
*/
private final NodeT rootNode;
/**
* the immediate parent graphs of this graph. A parent graph is the one with it's root
* depends on this graph's root.
* the immediate parent graphs of this graph. A parent graph is the one with its root
* depending on this graph's root.
*/
protected List<DAGraph<DataT, NodeT>> parentDAGs;
/**
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

package com.azure.resourcemanager.resources.fluentcore.dag;

/**
* An FailedDependencyTaskException is emitted when a task cannot be executed due to a faulted decedent task.
*/
final class FailedDependencyTaskException extends RuntimeException {
}
Original file line number Diff line number Diff line change
Expand Up @@ -280,11 +280,21 @@ public Mono<Indexable> invokeAsync(TaskGroup.InvocationContext context) {
});
}

@Override
public Indexable invoke(TaskGroup.InvocationContext context) {
taskResult = this.invokeTask(context);
return taskResult;
}

@Override
public Mono<Void> invokeAfterPostRunAsync(boolean isGroupFaulted) {
return Mono.empty();
}

@Override
public void invokeAfterPostRun(boolean isGroupFaulted) {
}

/**
* Invokes a task asynchronously.
*
Expand All @@ -293,6 +303,18 @@ public Mono<Void> invokeAfterPostRunAsync(boolean isGroupFaulted) {
*/
protected abstract Mono<Indexable> invokeTaskAsync(TaskGroup.InvocationContext context);

/**
* Invokes a task synchronously.
*
* @param context Context of the invocation.
* @return an Observable upon subscription emits {@link Indexable}.
*/
protected Indexable invokeTask(TaskGroup.InvocationContext context) {
//TODO(xiaofei) remove this default implementation
// once synchronous operation is supported across the board
return this.invokeTaskAsync(context).block();
}

/**
* Get an instance of VoidIndexable.
*
Expand Down
Loading