TickWheelExecutor

class TickWheelExecutor(wheelSize: Int, val tick: Duration)

Low resolution execution scheduler

Low resolution execution scheduler

Value Params
tick

duration between ticks

wheelSize

number of spokes on the wheel. Each tick, the wheel will advance a spoke

Constructor

primary constructor which immediately spins up a thread and begins ticking

Note

The ideas for org.http4s.blaze.util.TickWheelExecutor is based off of loosely came from the Akka scheduler, which was based on the Netty HashedWheelTimer which was in term based on concepts in George Varghese and Tony Lauck's paper 'Hashed and Hierarchical Timing Wheels: data structures to efficiently implement a timer facility'

Companion
object
class Object
trait Matchable
class Any

Value members

Concrete methods

def schedule(r: Runnable, timeout: Duration): Cancelable

Schedule the Runnable on the TickWheelExecutor

Schedule the Runnable on the TickWheelExecutor

Execution is performed on the TickWheelExecutors thread, so only extremely small tasks should be submitted with this method. timeouts of Inf duration are ignored, timeouts of zero or negative duration are executed immediately on the submitting thread.

Value Params
r

Runnable to be executed

timeout

Duration to wait before execution

Returns

a Cancellable. This is not a java.util.concurrent.Cancellable, which is a richer interface.

def schedule(r: Runnable, ec: ExecutionContext, timeout: Duration): Cancelable

Schedule the Runnable on the TickWheelExecutor

Schedule the Runnable on the TickWheelExecutor

timeouts of Inf duration are ignored, timeouts of zero or negative duration are executed immediately on the submitting thread.

Value Params
ec

ExecutionContext to submit the Runnable

r

Runnable to be executed

timeout

Duration to wait before execution

Returns

a Cancellable. This is not a java.util.concurrent.Cancellable, which is a richer interface.

def shutdown(): Unit

Concrete fields

val tick: Duration