Package org.threadly.concurrent
Tools to assist in writing high performing and safe concurrent java code. These are a
complement to the tools provided by java.util.concurrent.
-
Interface Summary Interface Description CallableContainer<T> Interface to implement if any classes are containing a callable.PrioritySchedulerService This interface represents schedulers which can not only execute and schedule tasks, but run based off a given priority as well.RunnableContainer Interface to implement if any classes are containing a runnable.SchedulerService This interface adds some more advanced features to a scheduler that are more service oriented.SubmitterExecutor A thread pool for executing tasks with provided futures.SubmitterScheduler A thread pool for scheduling tasks with provided futures.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. -
Class Summary Class Description AbstractPriorityScheduler Abstract implementation for implementations ofPrioritySchedulerService
.AbstractSubmitterExecutor Since the conversion to aSubmitterExecutor
from an executor is often the same (just using theListenableFutureTask
to wrap the task).AbstractSubmitterScheduler Similar to theAbstractSubmitterExecutor
this abstract class is designed to reduce code duplication for the multiple schedule functions.CentralThreadlyPool Threadly's centrally provided pool manager.ConfigurableThreadFactory Implementation ofThreadFactory
which is configurable for the most common use cases.ConfigurableThreadFactory.ConfigurableThreadFactoryBuilder Builder for configuring a newConfigurableThreadFactory
.ContainerHelper Typically used only internally by the threadly library.DoNothingRunnable Runnable
implementation which does no action.NoThreadScheduler Executor which has no threads itself.Poller Simple class for watching a condition and getting notified when a state has changed.PriorityScheduler Executor to run tasks, schedule tasks.ReschedulingOperation Abstract implementation for more complicated recurring behavior.RunnableCallableAdapter<T> Converts aRunnable
with a result into aCallable
.SameThreadSubmitterExecutor ASubmitterExecutor
that will run all provided tasks immediately in the same thread that is invoking into it with the task.SchedulingUtils Class for helping calculate the offset for scheduling tasks.SingleThreadScheduler A simple and light weight implementation of theSchedulerService
.ThreadReferencingThreadFactory A thread factory which keeps aWeakReference
to each thread.ThreadReferencingThreadFactory.ThreadReferencingThreadFactoryBuilder Builder for configuring a newThreadReferencingThreadFactory
.UnfairExecutor A very high performanceSubmitterExecutor
implementation.UnfairExecutor.AtomicStripeGenerator Stripe generator which will round robin distribute tasks to threads.UnfairExecutor.TaskHashXorTimeStripeGenerator Generator which will determine the task stripe by using the identity hash of the runnable andClock.lastKnownTimeNanos()
. -
Enum Summary Enum Description TaskPriority Priority to go with tasks when being submitted into implementations ofPrioritySchedulerService
.