Questions tagged [cyclops-react]

Cyclops react is a comprehensive functional reactive platform for JDK8.

Cyclops react is a comprehensive functional reactive platform for JDK8.

Features include:

  • Compatible extensions to JDK interfaces (Collections, Streams, Functions) Built with jOOλ, reactive-streams ,Agrona and pCollections
  • Extensions for efficient JDK compatible persistent collections (pCollections) FutureStreams for managing aggregates for Future Tasks (e.g. for multi-threaded execution of large numbers of I/O tasks)
  • Single-threaded asynchronous streaming
  • Scheduling of data emission
  • Powerful extended type hierarchy for aggregrations (Collections & Streams) and single values
  • Powerful functional-style control structures, implemented in Java friendly manner (Maybe, Eval, FutureW, Xor, Ior, Try, AnyM, structural & guard based pattern matching, for-comprehensions)
  • Execute functions between wrapped values (Optional / CompletableFutre etc) without tedious unwrapping (Java friendly Applicative support).
  • Java friendly abstractions for wrapping any Monad type (Stream, CompletableFuture, Optional, cyclops-react types and types from other Java projects too). AnyM and it's two subtypes AnyMSeq for aggregates (Steam, List etc) and AnyMValue for Values
  • Monad Transformers - for manipulating nesting monadic types (e.g. Optionals within a Stream as if it were just an Optional)
  • Applicatives - apply functions across wrapped types (e.g. Optional / Maybe / Xor) without unwrapping & aggregate without terminate on failure Structural pattern matching & pattern matching via Guards (see Matchable and Matchables)
  • Full strength for comprehensions / generators (reference elements from other generators)
  • Tight integration with reactive-streams : collections, streams and datatypes are publishers & can be generated via subscribers
  • Very Extensible & integration with other projects via cyclops-integration modules.

GitHub project: https://github.com/aol/cyclops-react

7 questions
3
votes
2 answers

How to map a "Try with resources" exception type?

In a Cyclops React "Try with Resources" block, I would like to map an IOException to a custom exception type. I have tried this also with Javaslang and seems less fexible since it treats all exceptions the same. Code example: private static…
Xavier Arias
  • 162
  • 2
  • 10
3
votes
1 answer

How to instrument streams and track progress? (vanilla Java8 or cylcops-react reactive streams)

Given some code using streams to process a large number of items, what's the best way to instrument the various steps for logging and performance/profiling? Actual example: ReactiveSeq.fromStream(pairs) …
Casey
  • 6,166
  • 3
  • 35
  • 42
3
votes
1 answer

cyclops-react: No batching functions on ReactiveSeq?

Using cyclops-react 1.0.0-RC3, I tried to recreate the examples on the cyclops-react streams user guide with batching. I found that some methods were missing from ReactiveSeq, including batchBySize and windowByTime. I did find these methods on…
James Burton
  • 132
  • 9
2
votes
1 answer

cyclops-react and async-retry: How to retry on timeout?

I'm starting to use cyclops-react with async-retry. I'm still a little bit lost with it. I'm using SimpleReact and simulating a timeout from the server but I never receive a timeout with something like this: private List executeParallel() { …
Jorge
  • 184
  • 1
  • 8
1
vote
1 answer

Cannot run concurrent subscribers consistently using cyclops-react

Is it possible to have concurrent subscribers using cyclops-react library? For example, if a run the following code: ReactiveSeq initialStream = ReactiveSeq.of(1, 2, 3, 4, 5, 6); ReactiveSubscriber sub1 =…
Pedro Alipio
  • 117
  • 1
  • 8
1
vote
1 answer

LazyFutureStream and multiple thread persistence

I am using simple-react. Inside LazyFutureStream I want to persist the entity . LazyFutureStream.parallel(1,2,3,4,5) .map(id -> { try { SessionFactory sessionFactory = Application.getHibernateBundle() …
T.J.
  • 1,466
  • 3
  • 19
  • 35
0
votes
1 answer

Using cyclops-react for batching on a async queue stream

I am trying to use cyclops-react to batch the elements from a queue, based on size, but also on time, so it doesn't block when there are no elements Maybe the functionality is not what I expected or I am doing something wrong The complete code…