增加hasListener判断

This commit is contained in:
zhou-hao
2021-09-03 18:18:19 +08:00
parent e70a72d13b
commit 0658d64f18

View File

@@ -10,7 +10,10 @@ public class DefaultAsyncEvent implements AsyncEvent {
@Getter
private Mono<Void> async = Mono.empty();
private boolean hasListener;
public synchronized void async(Publisher<?> publisher) {
hasListener = true;
this.async = async.then(Mono.from(publisher).then());
}
@@ -21,4 +24,8 @@ public class DefaultAsyncEvent implements AsyncEvent {
return this.async;
}
public boolean hasListener() {
return hasListener;
}
}