2020-09-02 18:35:03 +08:00
|
|
|
/*
|
|
|
|
|
* Copyright (C) 2020 the original author or authors.
|
|
|
|
|
*
|
|
|
|
|
* This program is free software: you can redistribute it and/or modify
|
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
|
* the Free Software Foundation, either version 3 of the License, or
|
|
|
|
|
* any later version.
|
|
|
|
|
*
|
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
|
*
|
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
|
|
|
*/
|
2020-10-21 10:01:04 +08:00
|
|
|
|
2020-09-04 19:43:19 +08:00
|
|
|
package we.util;
|
2020-09-02 18:35:03 +08:00
|
|
|
|
2021-02-01 15:18:26 +08:00
|
|
|
import reactor.core.publisher.Flux;
|
2020-09-02 18:35:03 +08:00
|
|
|
import reactor.core.publisher.Mono;
|
|
|
|
|
|
|
|
|
|
/**
|
2020-10-21 10:01:04 +08:00
|
|
|
* @author hongqiaowei
|
2020-09-02 18:35:03 +08:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
public interface ReactorUtils {
|
|
|
|
|
|
2021-02-01 15:18:26 +08:00
|
|
|
static final Object OBJ = new Object();
|
2020-09-02 18:35:03 +08:00
|
|
|
|
2021-02-01 15:18:26 +08:00
|
|
|
static final Object NULL = OBJ;
|
2020-09-02 18:35:03 +08:00
|
|
|
|
2021-02-02 11:37:16 +08:00
|
|
|
static final Throwable EMPTY_THROWABLE = Utils.throwableWithoutStack(null); // XXX
|
2020-09-02 18:35:03 +08:00
|
|
|
|
2021-02-01 15:18:26 +08:00
|
|
|
static Mono getInitiateMono() {
|
|
|
|
|
return Mono.just(OBJ);
|
|
|
|
|
}
|
2020-09-02 18:35:03 +08:00
|
|
|
|
2021-02-01 15:18:26 +08:00
|
|
|
static Flux getInitiateFlux() {
|
|
|
|
|
return Flux.just(OBJ);
|
|
|
|
|
}
|
2020-09-02 18:35:03 +08:00
|
|
|
}
|