Package net.phoenix
Interface Callback<T extends Event>
- Type Parameters:
T
- Event
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
Simple callback
-
Method Summary
-
Method Details
-
call
Can be used in two ways;eventEmitter.on("channel", (channel, event) -> { // Handle Event }
public class EventHandler implements Callback<CustomEvent> {
@Override
public void call(String channel, CustomEvent event) { // Handle Event } } eventEmitter.on("channel, new EventHandler());- Parameters:
channel
- Channel that message is incoming from. If it is channel specific, it will be the channel name it was registered under. If it is a globalevent
- Instance of event
-