Skip to content

tintinscorpion/ChannelBus

Repository files navigation

ChannelBus


This library is based on [Kotlin Coroutines Channel](https://kotlinlang.org/docs/reference/coroutines/channels.html).

This is static code analysis performed with SonarQube AnalysisReport

Implementation:
App Level:
implementation 'com.github.tintinscorpion:ChannelBus:{latest_version}'
Project Level:
maven { url 'https://jitpack.io' }
  • Register event class:
ChannelBus.registerEvent(contextName: String, eventDispatcher: CoroutineDispatcher, eventClass: Class<T>, eventCallback: (T) -> Unit)
  • And unregister into onDestroy or onStop by your logic:
ChannelBus.unregisterAllEvents() - for all Events

or

ChannelBus.unregisterByContext(contextName: String)
  • Send event:
ChannelBus.send(event: Any, delaySend: Long = 0)

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages