Documentation of 'com.datumbox.framework.common.concurrency.ThrottledExecutor' Java class
ThrottledExecutor
com.datumbox.framework.common.concurrency

Class ThrottledExecutor

  • All Implemented Interfaces:
    java.util.concurrent.Executor


    public class ThrottledExecutor
    extends java.lang.Object
    implements java.util.concurrent.Executor
    The ThrottledExecutor enables us to throttle the input of the executor. This can be useful when we don't wish to submit all the tasks at once in order to preserve memory.
    • Constructor Summary

      Constructors 
      Constructor and Description
      ThrottledExecutor(java.util.concurrent.Executor executor, int maxConcurrentTasks)
      This Executor will block the main thread (when execute() is called) if the number of submitted and unfinished tasks reaches the provided limit.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      void execute(java.lang.Runnable command)
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ThrottledExecutor

        public ThrottledExecutor(java.util.concurrent.Executor executor,
                                 int maxConcurrentTasks)
        This Executor will block the main thread (when execute() is called) if the number of submitted and unfinished tasks reaches the provided limit. This enabled us to pace the input and reduce memory consumption.
        Parameters:
        executor -
        maxConcurrentTasks -
    • Method Detail

      • execute

        public void execute(java.lang.Runnable command)
        Specified by:
        execute in interface java.util.concurrent.Executor

DataMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.