
com.pubnub.internal.subscribe.eventengine.effect.effectprovider.HandshakeProviderImpl.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of pubnub-kotlin-impl Show documentation
Show all versions of pubnub-kotlin-impl 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.internal.subscribe.eventengine.effect.effectprovider
import com.pubnub.api.endpoints.remoteaction.RemoteAction
import com.pubnub.api.endpoints.remoteaction.map
import com.pubnub.internal.PubNubImpl
import com.pubnub.internal.endpoints.pubsub.SubscribeEndpoint
import com.pubnub.internal.subscribe.eventengine.event.SubscriptionCursor
internal class HandshakeProviderImpl(val pubNub: PubNubImpl) : HandshakeProvider {
override fun getHandshakeRemoteAction(
channels: Set,
channelGroups: Set,
state: Map?,
): RemoteAction {
val subscribe = SubscribeEndpoint(pubNub)
subscribe.channels = channels.toList()
subscribe.channelGroups = channelGroups.toList()
subscribe.timetoken = 0
subscribe.region = null
subscribe.state = state
return subscribe.map { SubscriptionCursor(it.metadata.timetoken, it.metadata.region) }
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy