Coroutines Event Pipe

Additional

Language
Kotlin
Version
N/A
Created
Jul 26, 2019
Updated
Jul 29, 2019
Owner
Daniil Pavenko (Daniil-Pavenko)
Contributor
Daniil Pavenko (Daniil-Pavenko)
1
Activity
Badge
Generate
Download
Source code
APK file

Blurb

Library EventPipe similar to EventBus

This library base on Kotlin Coroutines Channel.

1. Implementation by Gradle.
implementation 'com.github.Daniil-Pavenko:coroutines-event-pipe:1.0.0'
2. Methods for using:
  • Register event class:
EventPipe.registerEvent(contextName: String, eventDispatcher: CoroutineDispatcher, eventClass: Class<T>, eventCallback: (T) -> Unit)
  • And unregister into onDestroy or onStop by your logic:
EventPipe.unregisterAllEvents() - for all Events

or

EventPipe.unregisterByContext(contextName: String)
  • Send event:
EventPipe.send(event: Any, delaySend: Long = 0)
3. Configure proguard rules.
  • Add package of lib.
  • Add package with Event classes.
#EventPipe
-keep class com.dansdev.libeventpipe.** { *; }