mirror of
https://github.com/hs-web/hsweb-framework.git
synced 2026-06-09 17:34:50 +08:00
增加hasListener判断
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user