EventApi

expect class EventApi(connection: Connection) : AutoCloseable

Manages PrivMX Bridge context custom events.

Parameters

connection

active connection to PrivMX Bridge

Throws

when passed Connection is not connected.

actual class EventApi(connection: Connection) : AutoCloseable

Manages PrivMX Bridge context custom events.

Parameters

connection

active connection to PrivMX Bridge

Throws

when passed Connection is not connected.

actual class EventApi(connection: Connection) : AutoCloseable

Manages PrivMX Bridge custom events.

Parameters

connection

active connection to PrivMX Bridge

Throws

when passed Connection is not connected.

Constructors

Link copied to clipboard
expect constructor(connection: Connection)
actual constructor(connection: Connection)
actual constructor(connection: Connection)

Types

Link copied to clipboard
object Companion

Functions

Link copied to clipboard
expect fun buildSubscriptionQuery(channelName: String, selectorType: CustomEventSelectorType, selectorId: String): String

Generate subscription Query for the custom events.

actual fun buildSubscriptionQuery(channelName: String, selectorType: CustomEventSelectorType, selectorId: String): String

Generate subscription Query for the custom events.

actual fun buildSubscriptionQuery(channelName: String, selectorType: CustomEventSelectorType, selectorId: String): String

Generate subscription Query for the custom events.

Link copied to clipboard
expect open override fun close()

Frees memory.

actual open override fun close()

Frees memory.

actual open override fun close()

Frees memory.

Link copied to clipboard
expect fun emitEvent(contextId: String, users: List<UserWithPubKey>, channelName: String, eventData: ByteArray)

Emits the custom event on the given Context and channel.

actual fun emitEvent(contextId: String, users: List<UserWithPubKey>, channelName: String, eventData: ByteArray)

Emits the custom event on the given Context and channel.

actual external fun emitEvent(contextId: String, users: List<UserWithPubKey>, channelName: String, eventData: ByteArray)

Emits the custom event on the given Context and channel.

Link copied to clipboard
expect fun subscribeFor(subscriptionQueries: List<String>): List<String>

Subscribe for the custom events on the given subscription query.

actual fun subscribeFor(subscriptionQueries: List<String>): List<String>

Subscribe for the custom events on the given subscription query.

actual external fun subscribeFor(subscriptionQueries: List<String>): List<String>

Subscribe for the custom events on the given subscription query.

Link copied to clipboard
expect fun unsubscribeFrom(subscriptionIds: List<String>)

Unsubscribe from events with the given subscriptionId.

actual fun unsubscribeFrom(subscriptionIds: List<String>)

Unsubscribe from events with the given subscriptionId.

actual external fun unsubscribeFrom(subscriptionIds: List<String>)

Unsubscribe from events with the given subscriptionId.