@Retention(value=RUNTIME)
@Target(value=METHOD)
public @interface Subscribe
Bus.
The method's first parameter defines the event type.
Main mode
If subscriber's mode is undefined or
Mode.Main, then this subscriber will be called
in main bus thread.
Background mode
If subscriber's mode is Mode.Background
then subscriber will be called in a background thread.
For subscriber notified in background you can also specify a
queue name. All subscribers with the same
queue name are notified serially, meaning there is
only one active (called) subscriber at a time. Different queues
processed in parallel, completely independent of each other.
This ensures, that database events processed in a one queue do not get blocked by possibly much slower events processed in another queue.
You cannot expect, that same queue is always processed by same background thread.
If queue is not specified, then default "global"
queue is used.