WorkflowConfig
public class WorkflowConfig : @unchecked Sendable
Workflow configuration
-
Use a list instead of a map to allow registering a module twice with different configurations
Declaration
Swift
public private(set) var modules: [any ModuleRegistryProtocol] { get } -
Timeout for the HTTP client, default is 15 seconds
Declaration
Swift
public var timeout: TimeInterval -
Logger for the workflow, default is NoneLogger
Declaration
Swift
public var logger: Logger { get set } -
HTTP client for the engine
Declaration
Swift
public internal(set) var httpClient: HttpClient { get } -
Initializes a new WorkflowConfig instance.
Declaration
Swift
public init() -
Register a module.
Declaration
Swift
public func module<T: Sendable>(_ module: Module<T>, priority: Int = 10, mode: OverrideMode = .override, _ config: @escaping @Sendable (T) -> (Void) = { _ in })Parameters
moduleThe module to be registered.
priorityThe priority of the module in the registry. Default is 10.
modeThe mode of the module registration. Default is
override. If the mode isoverride, the module will be overridden if it is already registered.configThe configuration for the module.
-
Registers the workflow
Declaration
Swift
public func register(workflow: Workflow)Parameters
workflowThe workflow to be registered.
View on GitHub