InternalTimer

cc.otavia.core.timer.InternalTimer

Schedules TimerTasks for one-time future execution in a background thread.

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Known subtypes

Members list

Value members

Abstract methods

def newTimeout(task: TimerTask, delay: Long, unit: TimeUnit): Timeout

Schedules the specified TimerTask for one-time execution after the specified delay.

Schedules the specified TimerTask for one-time execution after the specified delay.

Value parameters

delay

one-time execution delay.

task

task to execute.

unit

one-time execution delay time unit.

Attributes

Returns

a handle which is associated with the specified task

Throws
IllegalStateException

if this timer has been stop stopped already

RejectedExecutionException

if the pending timeouts are too many and creating new timeout can cause instability in the system.

def newTimeout(task: TimerTask, delay: Long, unit: TimeUnit, period: Long, punit: TimeUnit): Timeout

Schedules the specified TimerTask for one-time execution after the specified delay and then periodic execution with period delay.

Schedules the specified TimerTask for one-time execution after the specified delay and then periodic execution with period delay.

Value parameters

delay

one-time execution delay.

period

periodic execution delay.

punit

periodic execution delay time unit.

task

task to execute.

unit

one-time execution delay time unit.

Attributes

Returns

a handle which is associated with the specified task

Throws
IllegalStateException

if this timer has been stop stopped already

RejectedExecutionException

if the pending timeouts are too many and creating new timeout can cause instability in the system.

def stop: Set[Timeout]

Releases all resources acquired by this InternalTimer and cancels all tasks which were scheduled but not executed yet.

Releases all resources acquired by this InternalTimer and cancels all tasks which were scheduled but not executed yet.

Attributes

Returns

the handles associated with the tasks which were canceled by this method