Riddle number 6 does not check for parallelism
See original GitHub issueHey,
There is a small problem with riddle number 6 and it is up to you guys how you want to solve it. In the task description there is mentioned that
Execute both [first] and [second] Single’s in parallel…
however you solution works sequentially. Thats because there are no schedulers running on mentioned Singles which means everything executes on main thread. Test is passing because it is not really checking for parallelism. If you would want to do that you could
val first = Single.timer(5, SECONDS, rxRule)
.map { 10 }
.doOnSubscribe { subscribeCounter.incrementAndGet() }
val second = Single.timer(3, SECONDS, rxRule)
.map { 5 }
.doOnSubscribe { subscribeCounter.incrementAndGet() }
// rest of the test goes here...
rxRule.advanceTimeBy(4, SECONDS)
// check if second already finished and the first one did not
first.test().assertNotComplete()
second.test().assertComplete()
You get the idea. So if the intention was to check for parallelism you need to adjust solution. If solution is good then you need to adjust the description.
Issue Analytics
- State:
- Created 5 years ago
- Comments:5 (4 by maintainers)
Top Results From Across the Web
Parallelism (Page 1) / Help Me ! / Math Is Fun Forum
I just need help with checking these if they're right. ... D no. E yes. F none of the above. 4. If angle...
Read more >Sentence Parallel Structure - Exercise 2 - Towson University
Revise each sentence so that the elements joined by the coordinate conjunction are parallel to one another. Write your answers in the space...
Read more >The Passcode Riddle: A Parallel Example in R
Summary: The passcode riddle asks for three three whole positive numbers with each one being equal to or larger than the next.
Read more >Aristotle's Number Puzzle | Mastering Parallel Programming ...
The puzzle we will solve is known as Aristotle's Number Puzzle, ... For a partial line, a check is made to ensure that...
Read more >Situation Puzzles Answers - Jed Hartman
1.1 answer: The man was in a ship that was wrecked on a desert island. When there was no food left, another passenger...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I don’t quite understand the problem.
RxRule is having a Scheduler that will run. The essential part is that subscribe is called eagerly. Which is asserted with
assertEmpty()
&assertThat(subscribeCounter.get()).isEqualTo(2) // We want to subscribe immediately.
@vanniktech took me a while to find time for this, here is my suggestion. I believe not providing a scheduler and not changing the comment is the way to go for this to still be a
riddle
😉 Let me know what you think