CommandDispatcher

open class CommandDispatcher : Dispatcher

Base class for command-based dispatchers that route dispatches through an internal command registry.

Provides a concrete implementation for dispatch() that supports async commands with cancellation via Disposable, calling completion once per Dispatch as it finishes.

Usage

class MyVendorDispatcher: CommandDispatcher {
    private let vendorInstance: VendorInterface

    init(context: TealiumContext, vendorInstance: VendorInterface) {
        self.vendorInstance = vendorInstance
        super.init(
            id: "MyVendor",
            version: "1.0.0",
            commands: [...],
            logCategory: "MyVendor",
            queue: context.queue,
            logger: context.logger
        )
    }
}

Module Properties

  • id

    Declaration

    Swift

    public let id: String
  • Declaration

    Swift

    public let version: String
  • Declaration

    Swift

    open var dispatchLimit: Int { get }

Command Infrastructure

Initialization

Dispatcher