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
module
The module to be registered.
priority
The priority of the module in the registry. Default is 10.
mode
The mode of the module registration. Default is
override
. If the mode isoverride
, the module will be overridden if it is already registered.config
The configuration for the module.
-
Registers the workflow
Declaration
Swift
public func register(workflow: Workflow)
Parameters
workflow
The workflow to be registered.