Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add Ix.fromSuppliers #15

Closed
wants to merge 1 commit into from
Closed

add Ix.fromSuppliers #15

wants to merge 1 commit into from

Conversation

q-ikawa
Copy link

@q-ikawa q-ikawa commented Nov 20, 2017

This provides simplified constructor for IxSuppliers<T>.

This makes more easier to build Ix<T> from Suppiers<T> , like:

for(Result result: Ix.fromSuppliers( requestA::get , requestB::get, requestC::get )){
  // request*.get() may use many computing resources.
  resultConsumer.accept(result);
}

or Ix.fromSuppliers( requestA::get , requestB::get, requestC::get ).subscribe(resultConsumer::accept);

I know that it can be substituted by Ix.forloop, but I think this makes production codes more simpler or readable in some cases.

@codecov
Copy link

codecov bot commented Nov 20, 2017

Codecov Report

Merging #15 into 1.x will decrease coverage by 0.07%.
The diff coverage is 90.9%.

Impacted file tree graph

@@            Coverage Diff             @@
##              1.x      #15      +/-   ##
==========================================
- Coverage     100%   99.92%   -0.08%     
- Complexity    504      507       +3     
==========================================
  Files         103      104       +1     
  Lines        2526     2548      +22     
  Branches      314      317       +3     
==========================================
+ Hits         2526     2546      +20     
- Misses          0        1       +1     
- Partials        0        1       +1
Impacted Files Coverage Δ Complexity Δ
src/main/java/ix/IxFromSuppliers.java 100% <100%> (ø) 2 <2> (?)
src/main/java/ix/Ix.java 99.42% <50%> (-0.58%) 231 <1> (+1)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update add721b...fd0028a. Read the comment docs.

@akarnokd
Copy link
Owner

Thanks, but this pattern is quite unusual for IxJava (and RxJava) and can be emulated via various ways, such as:

Ix.<IxSupplier<T>>fromArray(requestA::get , requestB::get, requestC::get).map(IxSupplier::get).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants