Commit
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,7 +18,7 @@ | |
package javax.enterprise.event; | ||
|
||
import java.lang.annotation.Annotation; | ||
|
||
import java.util.function.Consumer; | ||
import javax.enterprise.util.TypeLiteral; | ||
|
||
/** | ||
|
@@ -98,6 +98,28 @@ public interface Event<T> { | |
*/ | ||
public void fire(T event); | ||
|
||
/** | ||
* <p> | ||
* Fires an event with the specified qualifiers and notifies observers asynchronously. | ||
* </p> | ||
* | ||
* @param event the event object | ||
* @throws IllegalArgumentException if the runtime type of the event object contains a type variable | ||
This comment has been minimized.
Sorry, something went wrong. |
||
*/ | ||
public void fireAsynchronous(T event); | ||
|
||
/** | ||
* <p> | ||
This comment has been minimized.
Sorry, something went wrong.
mkouba
Contributor
|
||
* Fires an event with the specified qualifiers and notifies observers asynchronously. | ||
* After all observers have been called the container perform the provided callback code | ||
* </p> | ||
* | ||
* @param event the event object | ||
* @param callback a callback code to be called after all observers | ||
* @throws IllegalArgumentException if the runtime type of the event object contains a type variable | ||
*/ | ||
public void fireAsynchronous(T event, Consumer<T> callback); | ||
|
||
/** | ||
* <p> | ||
* Obtains a child <tt>Event</tt> for the given additional required qualifiers. | ||
|
How about renaming this method to
fireAsync
for simplification purposes?