Advertisement
Guest User

Untitled

a guest
Aug 18th, 2017
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.42 KB | None | 0 0
  1. @Scope("singleton")
  2. public class InternalDatabase {
  3.  
  4. private List<Transaction> memory;
  5.  
  6. public InternalDatabase() {
  7. if (this.memory == null) {
  8. this.memory = new ArrayList<>();
  9. }
  10. }
  11.  
  12. public Mono<Transaction> add (Transaction t) {
  13. this.memory.add(t);
  14. return Mono.just(t);
  15. }
  16.  
  17. public Flux<Transaction> get() {
  18. return Flux.fromIterable(this.memory).delayElements(Duration.ofMillis(300));
  19. }
  20.  
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement