All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.pubnub.internal.subscribe.eventengine.event.SubscribeEvent.kt Maven / Gradle / Ivy

package com.pubnub.internal.subscribe.eventengine.event

import com.pubnub.api.PubNubException
import com.pubnub.api.models.consumer.pubsub.PNEvent
import com.pubnub.internal.eventengine.Event

internal sealed class SubscribeEvent : Event {
    class SubscriptionChanged(channels: Set, channelGroups: Set) : SubscribeEvent() {
        val channels: Set = channels.toSet()
        val channelGroups: Set = channelGroups.toSet()
    }

    class SubscriptionRestored(
        channels: Set,
        channelGroups: Set,
        val subscriptionCursor: SubscriptionCursor,
    ) : SubscribeEvent() {
        val channels: Set = channels.toSet()
        val channelGroups: Set = channelGroups.toSet()
    }

    object Disconnect : SubscribeEvent()

    data class Reconnect(val subscriptionCursor: SubscriptionCursor? = null) : SubscribeEvent()

    object UnsubscribeAll : SubscribeEvent()

    data class HandshakeSuccess(val subscriptionCursor: SubscriptionCursor) : SubscribeEvent()

    data class HandshakeFailure(val reason: PubNubException) : SubscribeEvent()

    data class ReceiveSuccess(val messages: List, val subscriptionCursor: SubscriptionCursor) :
        SubscribeEvent()

    data class ReceiveFailure(val reason: PubNubException) : SubscribeEvent()
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy