Mirror von
https://github.com/PaperMC/Velocity.git
synchronisiert 2024-12-24 23:30:26 +01:00
Add async parameter to @Subscribe, also as a migration aid.
Dieser Commit ist enthalten in:
Ursprung
821ca02ee7
Commit
3944eec491
@ -26,4 +26,23 @@ public @interface Subscribe {
|
||||
*/
|
||||
PostOrder order() default PostOrder.NORMAL;
|
||||
|
||||
/**
|
||||
* Whether the handler must be called asynchronously.
|
||||
*
|
||||
* <p><strong>This option currently has no effect, but in the future it will. In Velocity 3.0.0,
|
||||
* all event handlers run asynchronously by default. You are encouraged to determine whether or
|
||||
* not to enable it now. This option is being provided as a migration aid.</strong></p>
|
||||
*
|
||||
* <p>If this method returns {@code true}, the method is guaranteed to be executed
|
||||
* asynchronously. Otherwise, the handler may be executed on the current thread or
|
||||
* asynchronously. <strong>This still means you must consider thread-safety in your
|
||||
* event listeners</strong> as the "current thread" can and will be different each time.</p>
|
||||
*
|
||||
* <p>If any method handler targeting an event type is marked with {@code true}, then every
|
||||
* handler targeting that event type will be executed asynchronously.</p>
|
||||
*
|
||||
* @return Requires async
|
||||
*/
|
||||
boolean async() default true;
|
||||
|
||||
}
|
||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren