Channel

public struct Channel : ChannelDescription

A channel that can be queried for information, or be published to using an Event.

  • The shortened channel name.

    This is the channel name without the type identifier prefix, e.g. "my-channel". It therefore does not expose channel type information, which can be inspected using type.

    Declaration

    Swift

    public let name: String
  • The full channel name.

    This is the channel name including the type identifier prefix, e.g. "private-my-channel". It is inferred from the name and the type.

    Declaration

    Swift

    public let fullName: String
  • The channel type.

    Declaration

    Swift

    public let type: ChannelType

Lifecycle

  • Creates a Channel based on a full name (including type prefix).

    The channel type is inferred based on the provided fullName. e.g. A fullName of "private-my-channel" results in a channel whose name is "my-channel" and a type of private.

    If a shortened name is accidentally used, this results in a channel of type public since no type prefix was provided.

    Declaration

    Swift

    public init(fullName: String)

    Parameters

    fullName

    The full channel name.

  • Creates a Channel based on a shortened name and a channel type.

    If a full name is accidentally used, this results in a channel whose type is determined by the type parameter, regardless of any type prefix that is present in the name string.

    Declaration

    Swift

    public init(name: String, type: ChannelType)

    Parameters

    name

    The shortened channel name.

    type

    The channel type.