ActionGroupConfiguration
@MainActor
public struct ActionGroupConfiguration<InteractorType, ContentType> : InteractorConfiguring, ActionCollectionConfiguring where InteractorType : InteractorTypeable, ContentType : ContentTypeable
Configures a group of Interactor actions which an ActionGroup runs in parallel as a single step in an ActionSequence.
Each child configuration makes its own Interactor request; when all have completed, the supplied SequenceGroupMerging object merges their results into a single content value which is passed on through the group’s output conduit. Children can cancel the group’s task on a per-child basis with GroupStepConfiguration‘s shouldEndParentTaskOnFailure property.
-
A group has no single action type of its own; this placeholder satisfies the
See moreActionConfiguringrequirement. Each child carries its own real action type.Declaration
Swift
public enum GroupActionType : InteractorRequestActionTypeable -
Undocumented
Declaration
Swift
public typealias ActionType = GroupActionType -
Declaration
Swift
@MainActor public let interactorType: InteractorType? -
Declaration
Swift
@MainActor public let actionType: GroupActionType -
Unused. A group has no single assistant. Each child builds its own.
Declaration
Swift
@MainActor public let assistant: InteractorAssistantType -
Declaration
Swift
@MainActor public let configurationType: ActionConfigurationType -
Declaration
Swift
@MainActor public var outputConduit: (any ActionSequenceConduiting<ContentType>)? -
An optional identifier of this group step, carried onto the group’s
ActionResult.Declaration
Swift
@MainActor public let identifier: (any ActionIdentifying)? -
Declaration
Swift
@MainActor public let shouldEndParentTaskOnFailure: Bool -
Declaration
Swift
@MainActor public let shouldSaveResult: Bool -
Determines whether the results of this group’s children are saved in its origin when the group’s result is passed on
Declaration
Swift
@MainActor public let shouldSaveChildResults: Bool -
An array of action configurations which the group should run in parallel.
Declaration
Swift
@MainActor public let actions: [any ActionConfiguring<InteractorType, ContentType>] -
Handles request output merging for this group action.
Declaration
Swift
@MainActor public let merger: (any ActionResultsMerging<ContentType>)? -
init(actions:merger: outputConduit: identifier: shouldEndParentTaskOnFailure: shouldSaveResult: shouldSaveChildResults: ) Creates a group configuration.
Declaration
Swift
@MainActor public init(actions: [any ActionConfiguring<InteractorType, ContentType>], merger: any ActionResultsMerging<ContentType>, outputConduit: (any ActionSequenceConduiting<ContentType>)? = nil, identifier: (any ActionIdentifying)?, shouldEndParentTaskOnFailure: Bool? = nil, shouldSaveResult: Bool? = nil, shouldSaveChildResults: Bool? = nil)Parameters
actionsThe configurations of the actions which should run in parallel within this group.
mergerAn object which merges the child action results into a single content value.
outputConduitAn optional conduit which passes the merged content on to the next step in the sequence.
typeAn optional type tagging this group step, used to locate the group’s result in an
ActionSequenceResultsobject. -
Declaration
Swift
@MainActor public func buildAssistant() throws -> any AsyncInteractorAssisting<InteractorType, ContentType> -
Declaration
Swift
@MainActor public func buildAction(resultHandler: any InteractorResultHandling<InteractorType, ContentType>) throws -> any ActionPerformable<ContentType>
View on GitHub