Interface UnfairExecutor.TaskStripeGenerator

  • All Known Implementing Classes:
    UnfairExecutor.AtomicStripeGenerator, UnfairExecutor.TaskHashXorTimeStripeGenerator
    Enclosing class:
    UnfairExecutor

    public static interface UnfairExecutor.TaskStripeGenerator
    Strategy for taking in a task and producing a long which will be translated to which thread the task should be distributed on to. This number is only a guide for the scheduler, the scheduler may choose another thread depending on what internal balancing may be possible.
    Since:
    4.5.0
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      long getStripe​(java.lang.Runnable task)
      Generate an identifier for the stripe to distribute the task on to.
    • Method Detail

      • getStripe

        long getStripe​(java.lang.Runnable task)
        Generate an identifier for the stripe to distribute the task on to.
        Parameters:
        task - Task which can be used for referencing in determining the stripe
        Returns:
        Any positive or negative long value to represent the stripe