-
Notifications
You must be signed in to change notification settings - Fork 119
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into 2068_analytics_to_flank_wrapper
- Loading branch information
Showing
30 changed files
with
209 additions
and
95 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
15 changes: 12 additions & 3 deletions
15
tool/execution/parallel/src/main/kotlin/flank/exection/parallel/Reduce.kt
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,32 @@ | ||
package flank.exection.parallel | ||
|
||
import flank.exection.parallel.internal.contextValidators | ||
import flank.exection.parallel.internal.contextValidatorTypes | ||
import flank.exection.parallel.internal.reduceTo | ||
import flank.exection.parallel.internal.type | ||
|
||
/** | ||
* Reduce given [Tasks] by [expected] types to remove unneeded tasks from the graph. | ||
* The returned graph will hold only tasks that are returning selected types, their dependencies and derived dependencies. | ||
* Additionally this is keeping also the validators for initial state. | ||
* Additionally, this is keeping also the validators for initial state. | ||
* | ||
* @return Reduced [Tasks] | ||
*/ | ||
operator fun Tasks.invoke( | ||
expected: Set<Parallel.Type<*>> | ||
): Tasks = | ||
reduceTo(expected + contextValidators()) | ||
reduceTo(expected + contextValidatorTypes()) | ||
|
||
/** | ||
* Shortcut for tasks reducing. | ||
*/ | ||
operator fun Tasks.invoke( | ||
vararg expected: Parallel.Type<*> | ||
): Tasks = invoke(expected.toSet()) | ||
|
||
/** | ||
* Remove the [Tasks] by given [types]. | ||
*/ | ||
operator fun Tasks.minus( | ||
types: Set<Parallel.Type<*>> | ||
): Tasks = | ||
filterNot { task -> task.type in types }.toSet() |
7 changes: 7 additions & 0 deletions
7
tool/execution/parallel/src/main/kotlin/flank/exection/parallel/Select.kt
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
package flank.exection.parallel | ||
|
||
/** | ||
* Select value by type. | ||
*/ | ||
@Suppress("UNCHECKED_CAST") | ||
fun <T : Any> ParallelState.select(type: Parallel.Type<T>) = get(type) as T |
Oops, something went wrong.