object DefaultTimer extends ProxyTimer
Finagle's default Timer that's intended to be shared across a number of servers/clients.
The default Timer is intended for scheduling tasks that will finish very quickly and shouldn't be used to schedule tasks that will occupy the executing thread for a significant duration.
Use DefaultTimer.Implicit
to import an implicit instance of this timer into the scope.
scala> import com.twitter.util.Future, com.twitter.conversions.DurationOps._ scala> import com.twitter.finagle.util.DefaultTimer.Implicit scala> val f = Future.sleep(10.seconds) f: com.twitter.util.Future[Unit] = <function0>
Java users may prefer DefaultTimer.getInstance()
to access this timer.
- Note
This timer is "unstoppable" such that calls to
stop()
is ignored.
- Alphabetic
- By Inheritance
- DefaultTimer
- ProxyTimer
- Timer
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- implicit val Implicit: Timer
An implicit instance supplied for use in the Future.* methods.
- var _self: Timer
- Attributes
- protected
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native()
- def doAt[A](time: Time)(f: => A): Future[A]
- Definition Classes
- Timer
- def doLater[A](delay: Duration)(f: => A): Future[A]
- Definition Classes
- Timer
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable])
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- def getInstance: Timer
A Java-friendly accessor for DefaultTimer.
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final def schedule(period: Duration)(f: => Unit): TimerTask
- Definition Classes
- Timer
- final def schedule(when: Time, period: Duration)(f: => Unit): TimerTask
- Definition Classes
- Timer
- final def schedule(when: Time)(f: => Unit): TimerTask
- Definition Classes
- Timer
- def scheduleOnce(when: Time)(f: => Unit): TimerTask
- Attributes
- protected
- Definition Classes
- ProxyTimer → Timer
- def schedulePeriodically(when: Time, period: Duration)(f: => Unit): TimerTask
- Attributes
- protected
- Definition Classes
- ProxyTimer → Timer
- def self: Timer
- Attributes
- protected
- Definition Classes
- DefaultTimer → ProxyTimer
- def setUnsafe(timer: Timer): Unit
Set the implementation of the underlying Timer.
Set the implementation of the underlying Timer. Use with caution for changing DefaultTimer after a Timer has been service loaded at runtime.
- Note
This can be unsafe if the Timer is slow and fails to meet throughput/latency requirements for task creation and task cancelation.
- def stop(): Unit
- Definition Classes
- DefaultTimer → ProxyTimer → Timer
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toString(): String
- Definition Classes
- DefaultTimer → AnyRef → Any
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()
Deprecated Value Members
- val twitter: Timer
An alias for DefaultTimer.
An alias for DefaultTimer.
- Annotations
- @deprecated
- Deprecated
(Since version 2017-5-4) Use DefaultTimer from Scala and DefaultTimer.getInstance() from Java