PipelineStageKey

public final class PipelineStageKey: _OpenEnum, CustomStringConvertible

An unique identifier for a PipelineStage within a Pipeline. Transformers and stages have no intrinsic notion of identity or equality, so these keys are the only way to alter transformers after they’re configured.

Stage keys are arbitrary, and have no intrinsic meaning. The descriptions of the default stages are for human comprehensibility, and Siesta does not enforce them in any way (e.g. it does not prevent you from configuring the rawData stage to output something other than Data).

Because this is not an enum, you can add custom stages:

extension PipelineStageKey {
  static let
    munging   = PipelineStageKey(description: "munging"),
    twiddling = PipelineStageKey(description: "twiddling")
}

...

service.configure {
    $0.pipeline.order = [.rawData, .munging, .twiddling, .cleanup]
}
  • A human-readable name for this key. Does not affect uniqueness, or any other logical behavior.

    Declaration

    Swift

    public let description: String
  • Creates a custom pipeline stage.

    Declaration

    Swift

    public init(description: String)
  • Response data still unprocessed. The stage typically contains no transformers.

    Declaration

    Swift

    public static let rawData = PipelineStageKey(description: "rawData")
  • Any bytes-to-bytes processing, such as decryption or decompression, not already performed by the network lib.

    Declaration

    Swift

    public static let decoding = PipelineStageKey(description: "decoding")
  • Transformation of bytes to an ADT or other generic data structure, e.g. a string, dictionary, or image.

    Declaration

    Swift

    public static let parsing = PipelineStageKey(description: "parsing")
  • Transformation from an ADT to a domain-specific model.

    Declaration

    Swift

    public static let model = PipelineStageKey(description: "model")
  • Error handling, validation, or any other general mop-up.

    Declaration

    Swift

    public static let cleanup = PipelineStageKey(description: "cleanup")