//core/com.petersamokhin.vksdk.core.api.botslongpoll/VkBotsLongPollApi
VkBotsLongPollApi¶
[common]\ class VkBotsLongPollApi@JvmOverloads()constructor(clientId: Int, api: VkApi, backgroundDispatcher: CoroutineDispatcher, json: Json) : CoroutineScope
Bots LongPoll API
Constructors¶
VkBotsLongPollApi | [common] @JvmOverloads() fun VkBotsLongPollApi(clientId: Int, api: VkApi, backgroundDispatcher: CoroutineDispatcher, json: Json = defaultJson()) |
Types¶
Name | Summary |
---|---|
Settings | [common] data class Settings(wait: Int, maxFails: Int) Long polling settings |
Functions¶
Name | Summary |
---|---|
clearListeners | [common] fun clearListeners() Clear listeners for all the events |
registerListener | [common] fun <T : Any> registerListener(type: String, listener: EventCallback<T>) Register listener for type of events |
startPolling | [common] fun startPolling(settings: VkBotsLongPollApi.Settings): Job Start long polling with settings |
stopPolling | [common] fun stopPolling() Stop the long polling loop |
unregisterListener | [common] fun unregisterListener(listener: EventCallback<*>): Boolean Remove listener |
Properties¶
Name | Summary |
---|---|
coroutineContext | [common] open override val coroutineContext: CoroutineContext Coroutine context for jobs |