Dispatch

public struct Dispatch

Represents a tracking event or view to be dispatched.

  • The payload data of the dispatch.

    Declaration

    Swift

    public internal(set) var payload: DataObject { get }
  • id

    The unique identifier of the dispatch.

    Declaration

    Swift

    public let id: String
  • The timestamp of when the dispatch was created, in Unix milliseconds.

    Declaration

    Swift

    public let timestamp: Int64
  • Creates a new dispatch with the specified parameters.

    Declaration

    Swift

    public init(name: String, type: DispatchType = .event, data: DataObject? = nil)

    Parameters

    name

    The name of the event or view.

    type

    The type of dispatch (event or view).

    data

    Optional additional data to include.

  • The name of this dispatch.

    Declaration

    Swift

    public var name: String? { get }
  • Enriches the dispatch with additional data.

    Declaration

    Swift

    public mutating func enrich(data: DataObject)
  • Replaces the current payload with a new one.

    Declaration

    Swift

    public mutating func replace(payload: DataObject)
  • Returns a short description suitable for logging.

    Declaration

    Swift

    public func logDescription() -> String

    Return Value

    A string containing the dispatch ID prefix and name.