schananas / practical-reactor Goto Github PK
View Code? Open in Web Editor NEWPractical Project Reactor and reactive programing workshop
License: MIT License
Practical Project Reactor and reactive programing workshop
License: MIT License
This is the place where you can post your feedback about exercises.
Are exercises too hard?
Are requirements clear enough?
How much time took you to finish all exercises?
Do you feel that your knowledge about Reactor improved after doing this workshop?
Any proposals for improvements or new exercises?
I use the code below
AtomicBoolean canceled = new AtomicBoolean(false);
Flux<Integer> temperatureFlux = room_temperature_service()
.doOnCancel(() -> canceled.set(true)) //todo: change this line only
;
StepVerifier.create(temperatureFlux.take(0))
.expectNextCount(0)
.verifyComplete();
Assertions.assertTrue(canceled.get());
The test case can pass when i use reactor-core:3.4.14.
But it can't pass when is use reactor-core:3.5.0-m2.
Is this a bug of reactor-core:3.5.0-m2 or has the behavior changed on eactor-core:3.5.0-m2?
I don't know how to fix it.
The comment creates confusion, because we actually need to adjust the first line to remove the null
and instead call the service and save the result to strings
variable.
Something like this would be better.
Flux<String> strings = null;
mashed_data_service()
//todo: replace null with mashed_data_service() call and your solution.
;
In the solution:
/**
* `number_service()` returns 300 numbers, but you only need 100 numbers, from the middle.
*/
@Test
public void golden_middle() {
Flux<Integer> numbers = number_service()
.skip(100) //this should be .skip(150) as 300/2 = 150
.take(100)
;
StepVerifier.create(numbers)
.expectNextMatches(i -> i >= 100) // this should be expectNextMatches(i -> i >= 100), as the middle number is 150
.expectNextCount(99)
.verifyComplete();
}
Hi, thank you for the project.
In c4_LifecycleHooks line 78,
@Test
public void atomic_counter() {
AtomicInteger counter = new AtomicInteger(0);
...
//I think wrong order.
Assertions.assertEquals(counter.get(), 20);
}
it change to
Assertions.assertEquals(20, counter.get());
because 20 is expected value.
thank you.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.