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

com.pubnub.internal.subscribe.eventengine.effect.SubscribeEffectInvocation.kt Maven / Gradle / Ivy

package com.pubnub.internal.subscribe.eventengine.effect

import com.pubnub.api.models.consumer.PNStatus
import com.pubnub.api.models.consumer.pubsub.PNEvent
import com.pubnub.internal.eventengine.Cancel
import com.pubnub.internal.eventengine.EffectInvocation
import com.pubnub.internal.eventengine.EffectInvocationType
import com.pubnub.internal.eventengine.Managed
import com.pubnub.internal.eventengine.NonManaged
import com.pubnub.internal.subscribe.eventengine.event.SubscriptionCursor

internal sealed class SubscribeEffectInvocation(override val type: EffectInvocationType) : EffectInvocation {
    override val id: String = "any value for NonManged and Cancel effect"

    data class ReceiveMessages(
        val channels: Set,
        val channelGroups: Set,
        val subscriptionCursor: SubscriptionCursor,
    ) : SubscribeEffectInvocation(Managed) {
        override val id: String = ReceiveMessages::class.java.simpleName
    }

    object CancelReceiveMessages :
        SubscribeEffectInvocation(Cancel(idToCancel = ReceiveMessages::class.java.simpleName))

    data class Handshake(
        val channels: Set,
        val channelGroups: Set,
    ) : SubscribeEffectInvocation(Managed) {
        override val id: String = Handshake::class.java.simpleName
    }

    object CancelHandshake :
        SubscribeEffectInvocation(Cancel(idToCancel = Handshake::class.java.simpleName))

    data class EmitStatus(val status: PNStatus) : SubscribeEffectInvocation(NonManaged)

    data class EmitMessages(val messages: List) : SubscribeEffectInvocation(NonManaged)
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy