com.zman.event.ConcurrentEventEmitter Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of event-emitter Show documentation
Show all versions of event-emitter Show documentation
Both thread-safe and non-thread-safe implementation.
The newest version!
package com.zman.event;
import java.util.*;
import java.util.concurrent.ConcurrentHashMap;
import java.util.function.Consumer;
/**
* thread-safe
*/
public class ConcurrentEventEmitter extends EventEmitter{
/**
* 事件 -> 函数列表
* 每当发生事件时,会按订阅顺序依次调用函数
*/
private Map