We were unable to load Disqus. If you are a moderator please see our troubleshooting guide.

charlie feng • 11 months ago

Thanks for the effort.
And could you provide the link to answer? just stucked on some questions

Han Wang • 2 months ago

Don't tryna be a smart-ass but here is my git repo with all the solutions:
Java: https://github.com/austinwa...
Kotlin: https://github.com/austinwa...

Anonymous • 7 months ago
Alexander Glukhovtsev • 3 years ago

For the last part ( Blocking to Reactive )
one can use almost exact snippets from here

GreenGO • 1 year ago

Say to capitalize, but assert for upper case

Christian Meyer • 1 year ago

Thanks for putting this together. Would definitely be nice to have some hints or solutions since it's easy to get stuck for a little while on small stuff. But overall can appreciate the time taken to provide this.

Mashrur Mia • 2 years ago

typo "in fact it can be though -> thought of as both a Subscriber to the operator upstream and a Publisher for downstream"

siddharth • 1 year ago

What hapen when the we subscriber request limited amount of data from publisher . for ex- request 10
then again subscriber requested 20 data form publisher..what will happen .
and mind it subscriber subscribe to publisher withe the limited request not with the Long.Max_Value .as per doc in the scenario
.

psk • 2 weeks ago

any idea wy i am unable to import the org.junit packages
can seem to run the test cases

Roger Deloy Pack • 1 month ago

I get an NPE clicking the "run this" button...

Anonymous • 6 months ago

After Click Run button, where to see the results of each test case?

shr • 9 months ago

void expectFooBarError(Flux<string> flux) { StepVerifier.create(flux).expectNext("foo").expectNext("bar").verifyError(RuntimeException.class);
}

shr • 9 months ago

void expectFooBarComplete(Flux<string> flux) {
StepVerifier.create(flux.just("foo","bar")).expectNext("foo").expectNext("bar").expectComplete().verify();
}

Dovi • 11 months ago

I love the Breaking Bad theme :D

Guest • 1 year ago
John • 2 months ago

The field in User class is username so getUsername is correct.

Nevyn • 1 year ago

Looking at the last problem on part 4 my expectation is that the supplier argument should be used. This is either not the case or I just don't know how to use it properly.

Maybe add some more information on what the expectation is in regards to the source of the data.

sbilello • 1 year ago

When you complete all of them are you going to receive a badge or achievement?

Aashish • 2 years ago

Is it a good idea to have pubisher and subscriber in the same app / Microservice and use Reactive-RabbitMq as reactive stream?

Mahantesh Ambali • 2 years ago

What is the answer for the last one. ? Unable to find. expect3600Elements

Raúl Montemayor Peralta • 2 years ago

Flux<long> counter() {
Duration period = Duration.of(100L, ChronoUnit.MILLIS);
return Flux.interval(period).take(10L);
}

Catio • 11 months ago

void expect3600Elements(Supplier<flux<long>> supplier) {
StepVerifier.withVirtualTime(supplier)
.expectSubscription()
.expectNoEvent(Duration.ofSeconds(1))
.thenAwait(Duration.ofHours(1))
.expectNextCount(3600)
.expectComplete()
.verify();
}

kojot • 1 year ago


void expect3600Elements(Supplier<flux<long>> supplier) {
final Duration duration = StepVerifier
.withVirtualTime(() -> Mono.delay(Duration.ofHours(1)))
.expectSubscription()
.expectNoEvent(Duration.ofSeconds(1))
.thenAwait(Duration.ofHours(1))
.expectNextCount(1)
.expectComplete()
.verify();
System.out.println(duration.toMillis());
}

This works to me, but I don't know why. I think it should by `.expectNextCount(3600)` or something like that.

Magdalena • 1 year ago

Flux<long> counter() {
return Flux.interval(Duration.ofMillis(100)).take(10);
}

Ankesh Kapil • 2 years ago

Flux<long> counter() {

return Flux.generate(() -> 0l, (state, sink) -> {
sink.next(state++);
if (state == 10l)
sink.complete();
return state;
});
}

Alexander Glukhovtsev • 3 years ago

It is nice that
one can add


import static org.assertj.core.api.Assertions.*;


or


import static org.junit.Assert.*;


to this snippet
and this will work just fine .

[CG]OlogN • 3 years ago

Hi Alexander, do you think you can send your pull requests on the GitHub project? https://github.com/reactor/...

Alexander Glukhovtsev • 3 years ago

Hi,
I don't know .
Sometimes incomplete or slightly incorrect information
pushes your to discover what is actually goes on .
So, in this particular case it was beneficial, for me .
And I'm inclined to leave this part of the tutorial as it is
( more challenging ) .

Alexander Glukhovtsev • 3 years ago

Also clever typo in withVirtualTime()method's name example,
I spend almost half an hour, reading error messages,
until I figured that out .
And it was a surprise, for me,
that java.util.function.Supplier is lambda itself .
Namely,
the method signature (void|:Unit|side effects) ->|=>|to Flux<T>
is equivalent to java.util.function.Supplier<Flux<T>>