Comments (4)
I'll try and take a look at this later today. Doing some remodeling at the house this weekend. :)
Sent from my iPhone
On May 18, 2013, at 9:34 AM, Roman Stepanenko [email protected] wrote:
The test creates this Composable (System.out.println are mine):
private Composable<Integer> createComposable(Dispatcher dispatcher) { return new Composable<Integer>(dispatcher) .map(new Function<Integer, Integer>() { @Override public Integer apply(Integer integer) { System.out.println("mapping: "+integer); return integer; } }) .reduce(new Function<Composable.Reduce<Integer, Integer>, Integer>() { @Override public Integer apply(Composable.Reduce<Integer, Integer> r) { int last = (null != r.getLastValue() ? r.getLastValue() : 1); System.out.println("reducing: last value: "+r.getLastValue()+", nextValue: "+r.getNextValue()); return last + r.getNextValue(); } }) .consume(new Consumer<Integer>() { @Override public void accept(Integer integer) { System.out.println("consuming: "+integer); latch.countDown(); } }); }
When I run the test, only consume method prints to console. Map and Reduce do not do anything.
Not sure what the test it trying to test - just speed of consuming (then kill map and reduce) or cumulative processing as well (then there is a bug somewhere because map and reduce don't produce any output)
—
Reply to this email directly or view it on GitHub.
from reactor.
I guess you also have seen the others composable tests if you're interested by quick logic examples:
- https://github.com/reactor/reactor/blob/master/reactor-groovy/src/test/groovy/reactor/groovy/GroovyComposableSpec.groovy
- https://github.com/reactor/reactor/blob/master/reactor-core/src/test/java/reactor/core/ComposableTests.java
from reactor.
There should be access to an initial Composable that will accept the first value. So the first reference should be Composable<Integer> cInt = new Composable<>(dispatcher)
. Then call map etc.. from that cInt
. When the logic is ready to be run, call cInt.accept(intValue)
which starts the whole processing chain.
from reactor.
Got it, working now, thank you for quick turnaround. Please fix the test later when you get a chance
from reactor.
Related Issues (20)
- Allow signed releases to Artifactory from GitHub Actions HOT 4
- Remove explicit occurrences of jcenter from build HOT 2
- Release: move tagging step at the end
- Use Spotless plugin to help enforce basic formatting / license HOT 3
- Use Spotless plugin to enforce and update copyright headers HOT 1
- [Reactor Gen4] Discussing switching to a JDK 17 baseline HOT 41
- [Reactor Gen4] Ensuring Reactor 3 can run along Reactor 4 HOT 13
- [Reactor Gen4] The Rationale for a Generation 4 of Reactor HOT 3
- Use Gradle 7.3 HOT 1
- Reproducible Builds
- Remove the Reactive Streams Commons from README.md
- Is there any connection between org.projectreactor:reactor-core and io.projectreactor:reactor-core ? HOT 2
- Incompatible reactor-kotlin-extensions used in 2020.0.x BOM HOT 1
- Add new module reactor-core-micrometer to 2022.0.0-M3 BOM
- No dependency management for `reactor-tools` with classifier `original` HOT 1
- Builds with japicmp should set onlyModified = true / onBinaryIncompatibleModified = false
- Update GHA workflows to avoid warnings around output APIs HOT 1
- Did we have some tools like Java-profilers for perfomance or cost analyzing?
- Consider enabling discussions tab on GitHub
- reactor-tools original classifier should also be part of the BOM HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from reactor.