Title

Java code posted by Stefan
created at 16 Mar 22:22, updated at 04 Apr 13:52

Edit | Back
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
final class MonoJust<T> 
extends Mono<T>
    implements Fuseable.ScalarCallable<T>, Fuseable {

  final T value;

  MonoJust(T value) {
    this.value = Objects.requireNonNull(value, "value");
  }

  @Override
  public T call() {
    return value;
  }

  @Override
  public T block(Duration m) {
    return value;
  }

  @Override
  public T block() {
    return value;
  }

  @Override
  public void subscribe(Subscriber<? super T> s) {
    s.onSubscribe(Operators.scalarSubscription(s, value));
  }
}
506 Bytes in 2 ms with coderay