greenrobot/EventBus ? reverse-engineered prompt

Reverse engineered prompt

Build me a small but solid publish and subscribe event bus for Android and plain Java, something that lets different parts of an app talk to each other without tight coupling.

I want to be able to define simple event classes, register subscribers with an annotation, post events from anywhere, and have callbacks happen on the right thread when needed, especially the main thread for Android. Please include the basic lifecycle friendly usage for activities and fragments, support background threads, subscriber priorities, and make it fast and lightweight.

Also add an annotation processor and subscriber index so registration does not rely on reflection when possible. Include a few tests and a simple example of how to use it in Android and Java. If you need to check current build or tooling details, look up the latest docs online first, but keep the implementation clean and easy to use.

Are you gonna build this?

make sure you review the code using coderabbit

Try freeSponsored — opens CodeRabbit in a new tab