com.pubnub.api.presence.eventengine.effect.PresenceEffectInvocation.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of pubnub-kotlin Show documentation
Show all versions of pubnub-kotlin Show documentation
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!
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))
}