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

com.pubnub.api.presence.eventengine.effect.PresenceEffectInvocation.kt Maven / Gradle / Ivy

Go to download

PubNub is a cross-platform client-to-client (1:1 and 1:many) push service in the cloud, capable of broadcasting real-time messages to millions of web and mobile clients simultaneously, in less than a quarter second!

There is a newer version: 10.2.0
Show newest version
package com.pubnub.api.presence.eventengine.effect

import com.pubnub.api.PubNubException
import com.pubnub.api.eventengine.Cancel
import com.pubnub.api.eventengine.EffectInvocation
import com.pubnub.api.eventengine.EffectInvocationType
import com.pubnub.api.eventengine.Managed
import com.pubnub.api.eventengine.NonManaged

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

    data class Heartbeat(
        val channels: Set,
        val channelGroups: Set,
    ) : PresenceEffectInvocation(NonManaged)

    data class Leave(
        val channels: Set,
        val channelGroups: Set,
    ) : PresenceEffectInvocation(NonManaged)

    class Wait : PresenceEffectInvocation(Managed) {
        override val id: String = Wait::class.java.simpleName
    }

    object CancelWait : PresenceEffectInvocation(Cancel(idToCancel = Wait::class.java.simpleName))

    class DelayedHeartbeat(
        val channels: Set,
        val channelGroups: Set,
        val attempts: Int,
        val reason: PubNubException?
    ) : PresenceEffectInvocation(Managed) {
        override val id: String = DelayedHeartbeat::class.java.simpleName
    }

    object CancelDelayedHeartbeat :
        PresenceEffectInvocation(Cancel(idToCancel = DelayedHeartbeat::class.java.simpleName))
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy