-
Notifications
You must be signed in to change notification settings - Fork 266
Home
Junchuan Wang edited this page Sep 1, 2020
·
39 revisions
ParSeq is a framework that makes it easier to write asynchronous code in Java.
- The framework provides sets of APIs that gracefully handle async code. The Promise interface makes chaining async code blocks easier and prevents callback hell; The functional programming interface encourages isolation of code logic from the code execution, so that the programmers can focused on input, output and code functionality.
- The framework has an engine to run codes as a task so that the code execution is traceable. ParSeq trace and Traceviz provides great value to inspect the lifecycle of tasks and their timing of executions.
- For async operations, ParSeq engines provides a serial execution model so that out-of-order execution of tasks are indeed sequential and can be thread-safe. Concurrency achieved by ParSeq engine is resource efficient. This execution model would also make programmers' life easier by reducing race condition.
- Rich APIs are provided to manage lifecycle events and exception handling of tasks.
ParSeq best suits these use-cases:
- Code uses operations that do not need to be synchronized (for example, out-of-order async operations, such as I/O).
- Programmers want to utilize the callbacks or method chaining in programming paradigm.
- Tasks are I/O intensive and would benefit from large number of concurrency.
- Need a finer granularity of concurrency than multi-threading and need the framework to manage the concurrency.
In detail, some of the key benefits of ParSeq are listed:
- Parallelization of asynchronous operations (such as IO)
- Serialized execution for non-blocking computation
- Code reuse via task composition
- Simple error propagation and recovery
- Execution tracing and visualization
- Tasks with retry policy
ParSeq 2.*.* requires java 8. If you are using older version of java please use ParSeq 1.4.2.
See CHANGELOG for list of changes.
To get started, it is recommended to read the User's Guide first. Users might also find Execution Model Introduction useful to help understand how ParSeq execute Task asynchronously. There is also a video tutorial with slides created by the team to walk through the basics.