Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Latest commit

 

History

History

cyclops-futurestream

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 

Cyclops FutureStream : Streams of asynchronously executing tasks / futures

FutureStream is a powerful lazy, asynchronous, parallel stream particularly well suited to performing blocking I/O operations. Get started by creating and configuring an instance of the Stream builder LazyReact.

e.g. to load, process and save a large number of files in parallel, we can use cyclops-futurestream like so..

 new LazyReact(10,10).of(arrayOfFilenames)
                      .map(this::loadFiles)
                      .map(this::processData)
                      .map(this::saveFiles)
                      .run();

Other features in this module include

  • StreamSource : for creating 'pushable' JDK Streams - Streams you can push new data into
  • SimpleReact : an easy to use, eager FutureStream
  • Pipes : for plumbing together your asynchronous parallel futurestreams

Get cyclops-futurestream

Examples

FutureStream - parallel / async Streaming

new LazyReact(100,100).generate(()->"data") //100 active tasks, 100 threads
                      .map(d->"produced on " + Thread.currentThread().getId())
                      .peek(System.out::println)
                      .map(this::process)
                      .flatMap(e->ReactiveSeq.range(0,e))
                      .run();

cyclops.futurestream

type description characteristics
FutureStream Asynchronous and parallel stream Lazy, async, parallel, Reactive
SimpleReact Asynchronous bulk operations on Futures Eager async
LazyReact Builder for FutureStreams
Pipes Event bus for managing data transfer via Adapters to connected data structures Async

cyclops.stream

type description characteristics
StreamSource A factory class for 'pushable' JDK Streams

More info

Articles