mirror of
https://github.com/hs-web/hsweb-framework.git
synced 2026-06-20 09:52:14 +08:00
增加异步事件支持
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
package org.hswebframework.web.event;
|
||||
|
||||
import lombok.Getter;
|
||||
import org.reactivestreams.Publisher;
|
||||
import reactor.core.publisher.Mono;
|
||||
|
||||
@Getter
|
||||
public class AsyncEvent {
|
||||
|
||||
private Mono<Void> async = Mono.empty();
|
||||
|
||||
public synchronized void async(Publisher<?> publisher) {
|
||||
this.async = async.then(Mono.from(publisher).then());
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user