You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As of v0.1, the ParallelFlow implementation uses an internal executor service to run work units in parallel. The idea behind this design is to be able to create and shutdown the executor service internally and free the user from having to do that.
However, the drawback of this design is that every parallel flow uses its own executor service, which is obviously not efficient since the creation of thread pools is expensive. Moreover, using an internal executor service is not open for customizations.
This is a trade-off between:
Lifecycle management of the executor service (creation/shutdown)
Efficiency (re-using the same executor service for all parallel flows) and customization of the executor service
I believe trading option 1 for option 2 is a wise decision. In the end, the executor service lifecyle management is a couple of lines of code, for example:
ExecutorServiceexecutorService = Executors.newFixedThreadPool(10);
// pass executorService to parallel flowexecutorService.shutdown();
The text was updated successfully, but these errors were encountered:
As of v0.1, the
ParallelFlow
implementation uses an internal executor service to run work units in parallel. The idea behind this design is to be able to create and shutdown the executor service internally and free the user from having to do that.However, the drawback of this design is that every parallel flow uses its own executor service, which is obviously not efficient since the creation of thread pools is expensive. Moreover, using an internal executor service is not open for customizations.
This is a trade-off between:
I believe trading option 1 for option 2 is a wise decision. In the end, the executor service lifecyle management is a couple of lines of code, for example:
The text was updated successfully, but these errors were encountered: