-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
🦜 Implement ElasticEvent
to allow magic treatment of EventManager#callEvent
#29
Comments
nuriofernandez
added a commit
that referenced
this issue
Jun 22, 2021
nuriofernandez
added a commit
that referenced
this issue
Jun 22, 2021
nuriofernandez
added a commit
that referenced
this issue
Jun 22, 2021
nuriofernandez
added a commit
that referenced
this issue
Jun 22, 2021
Testing class: import me.nurio.events.EventManager;
import me.nurio.events.ReflectedEventHandler;
public class ElasticEventTest {
public static void main(String[] args) {
EventManager eventManager = ReflectedEventHandler.createEventManager();
eventManager.callEvent(new TestEvent()); // void
AsyncResponse asyncResponse = eventManager.callEvent(new TestConsumableEvent());
eventManager.callEvent(new TestConsumableEvent()).onComplete(() -> {}); // void
String text = eventManager.callEvent(new StringReturnerEvent());
}
public static class TestEvent extends Event {}
public static class TestConsumableEvent extends ConsumableEvent {}
public static class ConsumableEvent extends ElasticEvent<AsyncResponse> {}
public static class StringReturnerEvent extends ElasticEvent<String> {}
interface AsyncResponse {
void onComplete(AsyncFunction asyncFunction);
}
@FunctionalInterface
interface AsyncFunction {
void onComplete();
}
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Implement a way to handle events after his completion open to different implementations.
The text was updated successfully, but these errors were encountered: