我目前有一个预定的执行程序,在这样的延迟后发送一条消息:
executor.schedule(new Runnable() {
public void run() {
emitter.emit( message );
}
}, delay, TimeUnit.MILLISECONDS);
Run Code Online (Sandbox Code Playgroud)
我需要另一个线程,它将侦听取消消息,该消息将发送不同的消息,我需要停止上述消息发送.如果没有收到取消消息,则上述正常发送.什么是最好的方法呢?
谢谢.