Skip to content

A simplified EventBus with abilities of event subscribe and distribution.

License

Notifications You must be signed in to change notification settings

FaDrYL/EventShuttle

Repository files navigation

EventShuttle

A simplified EventBus with abilities of event subscribe and distribution.

Use

dependencies {
    implementation 'com.github.FaDrYL:EventShuttle:{version}'
    ksp "com.github.FaDrYL.eventshuttle:eventshuttle-compiler:{version}"
}

Features

  • Function/method annotation for subscriber registration
  • Custom subscription channel
  • Async subscription
  • Multiprocessing event distribution

Multiprocessing Event Distribution

// Mesh Strategy
implementation "com.github.FaDrYL.eventshuttle:eventshuttle-mesh:{version}"

Remember to register strategy to use the mp feature:

val meshStrategy = MeshStrategy().apply {
    addRemoteSubscriber(application, "{target_package_name}")
}
EventShuttle.registerFlightStrategy(meshStrategy)

Also, add this to Apps' manifest:

<queries>
    <package android:name="{target_package_name}" />
</queries>

Demo: demo gif for multiprocessing

About

A simplified EventBus with abilities of event subscribe and distribution.

Resources

License

Stars

Watchers

Forks