Skip to content

v0.99.7 of simple-react

Compare
Choose a tag to compare
@johnmcclean johnmcclean released this 20 Jan 10:38
· 3114 commits to master since this release

New Feature Overview

Scheduling!

cron, fixedDelay or fixedRate

LazyFutureStream.generate( () -> "new job")
                .map(this::process)
                .schedule("0 * * * * ?", ex)
                .connect()
                .debounce(1,TimeUnit.DAYS)
                .forEach(this::logToDb); 

Pattern Matching!

Apply decision making seamlessly within a Stream

List<String> result = LazyFutureStream.of(1,2,3,4)
                                      .capture(e->e.printStackTrace())
                                      .patternMatch("",
                                        c->c.hasValuesWhere( (Integer i)->i%2==0 ).then(i->"even"),
                                        c->c.hasValuesWhere( (Integer i)->i%2!=0).then(i->"odd")
                                                     )
                                                     .toList();
assertThat(result,equalTo(Arrays.asList("odd","even","odd","even")));

For Comprehensions

Nested iteration over multiple Stream types.

LazyFutureStream.of(1,2,3)
                 .forEach2(a->IntStream.range(0,10), 
                         a->b-> a+b)
                 .toList()

//List[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 2, 3, 4, 5, 6, 7, 8, 
                         9, 10, 11, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12)]

singleOptional operator

 //Optional[1]
LazyFutureStream.of(1).singleOptional(); 

//Optional.empty
LazyFutureStream.of().singleOpional();

//Optional.empty
LazyFutureStream.of(1,2,3).singleOptional();

The 0.99.7 release updates the version of the following dependencies

  • cyclops to 7.2.0
  • Agrona to 0.49

and fixes the following issues

  • SimpleReact fromIterable should return SimpleReactStream
  • Queue leaks memory through sizeSignal bug #92 opened 2 days ago by lisa-lionheart 0.99.7
  • Add onEmptySwitch operator to LazyFutureStream enhancement #90 opened 2 days ago by johnmcclean-aol 0.99.7
  • Add elapsed operator to LazyFutureStream enhancement #89 opened 2 days ago by johnmcclean-aol 0.99.7
  • SimpleReact creation methods return the Base class rather than SimpleReactStream bug #88 opened 5 days ago by
  • dependency upgrade : upgrade to agron 0.4.9 enhancement #86 opened 14 days ago by johnmcclean-aol 0.99.7
  • New operators : schedule enhancement #78 opened 25 days ago by johnmcclean-aol 0.99.7
  • New operators : for-comprehensions enhancement #77 opened 27 days ago by johnmcclean-aol 0.99.7
  • New operators : subStream operator enhancement #76 opened 27 days ago by johnmcclean-aol 0.99.7
  • New operators : pattern matching operators enhancement #75 opened 27 days ago by johnmcclean-aol 0.99.7
  • New operators : permutations & combinations enhancement #74 opened 27 days ago by johnmcclean-aol 0.99.7
    • Issue constructing a LazyFutureStream from a single CompletableFuture bug #72 opened on Dec 2, 2015 by johnmcclean-aol

Adding simple-react as a Dependency

Gradle

compile group: 'com.aol.simplereact', name:'simple-react', version:'0.99.7’

Maven

 <dependency>
   <groupId>com.aol.simplereact</groupId>
     <artifactId>simple-react</artifactId>
      <version>0.99.7</version>
     <scope>compile</scope>
   </dependency>

Javadoc

http://www.javadoc.io/doc/com.aol.simplereact/simple-react/0.99.7