PhoenixListener

public protocol PhoenixListener : AnyObject

The PhoenixListener protocol describes methods of the Phoenix‘s listeners.

  • Called when a message is received.

    Declaration

    Swift

    func phoenix(_ phoenix: Phoenix, didReceive message: PhoenixMessage)

    Parameters

    phoenix

    The Phoenix object that triggered the event.

    message

    The received message.

  • Called when Phoenix connected.

    Declaration

    Swift

    func phoenixDidConnect(_ phoenix: Phoenix)

    Parameters

    phoenix

    The Phoenix object that triggered the event.

  • Called when Phoenix disconnected.

    Declaration

    Swift

    func phoenixDidDisconnect(_ phoenix: Phoenix, error: Error?)

    Parameters

    phoenix

    The Phoenix object that triggered the event.

    error

    An error object with the cause.

  • Called when the channel joined.

    Declaration

    Swift

    func phoenix(_ phoenix: Phoenix, didJoin topic: String)

    Parameters

    phoenix

    The Phoenix object that triggered the event.

    topic

    The channel’s topic.

  • Called when the channel closed.

    Declaration

    Swift

    func phoenix(_ phoenix: Phoenix, didClose topic: String, error: Error?)

    Parameters

    phoenix

    The Phoenix object that triggered the event.

    topic

    The channel’s topic.

    error

    An error object with the cause.