com.github.df.restypass.event.EventConsumer Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of resty-pass Show documentation
Show all versions of resty-pass Show documentation
High-Performance Restful Client Library
The newest version!
package com.github.df.restypass.event;
import java.util.function.Consumer;
/**
* event consumer
* Created by darrenfu on 17-7-23.
*/
@SuppressWarnings("unused")
public interface EventConsumer {
/**
* 注册事件.
*
* @param event the event
* @param consumer the consumer
*/
default void on(String event, Consumer consumer) {
EventBus.registerEventAndConsumer(event, consumer);
}
/**
* 注册一次性事件.
*
* @param event the event
* @param consumer the consumer
*/
default void once(String event, Consumer consumer) {
}
/**
* 获取事件key
*
* @return the event key
*/
String getEventKey();
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy