Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @Scope("singleton")
- public class InternalDatabase {
- private List<Transaction> memory;
- public InternalDatabase() {
- if (this.memory == null) {
- this.memory = new ArrayList<>();
- }
- }
- public Mono<Transaction> add (Transaction t) {
- this.memory.add(t);
- return Mono.just(t);
- }
- public Flux<Transaction> get() {
- return Flux.fromIterable(this.memory).delayElements(Duration.ofMillis(300));
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement