Optimize singleton
This commit is contained in:
parent
de5be6564e
commit
e34e1e5852
@ -106,6 +106,11 @@ public class DatabaseSingleton<U> extends ResourceSupport<DatabaseStage<U>, Data
|
||||
.handle(this::deserializeValue);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Mono<Void> set(U value) {
|
||||
return singleton.set(Mono.fromCallable(() -> serializeValue(value)));
|
||||
}
|
||||
|
||||
@Override
|
||||
public Mono<U> setAndGetPrevious(U value) {
|
||||
return Flux
|
||||
@ -168,6 +173,11 @@ public class DatabaseSingleton<U> extends ResourceSupport<DatabaseStage<U>, Data
|
||||
}));
|
||||
}
|
||||
|
||||
@Override
|
||||
public Mono<Void> clear() {
|
||||
return singleton.set(Mono.empty());
|
||||
}
|
||||
|
||||
@Override
|
||||
public Mono<U> clearAndGetPrevious() {
|
||||
return Flux
|
||||
|
Loading…
Reference in New Issue
Block a user