|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.netflix.hystrix.util.HystrixTimer
public class HystrixTimer
Timer used by the HystrixCollapser to trigger batch executions.
Used instead of java.util.Timer because:
HystrixCollapser instead of being generic to any tasks being submitted. Specifically, we can 'tick' every 10ms (for example) and fire all
HystrixCollapser interested in that time, rather than each instance needing a separate task that gets scheduled independently.
| Nested Class Summary | |
|---|---|
static interface |
HystrixTimer.TimerListener
|
| Method Summary | |
|---|---|
java.lang.ref.Reference<HystrixTimer.TimerListener> |
addTimerListener(HystrixTimer.TimerListener listener)
Add a HystrixTimer.TimerListener that will be executed until it is garbage collected or removed by clearing the returned Reference. |
static HystrixTimer |
getInstance()
Retrieve the global instance with a single backing thread. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static HystrixTimer getInstance()
public java.lang.ref.Reference<HystrixTimer.TimerListener> addTimerListener(HystrixTimer.TimerListener listener)
HystrixTimer.TimerListener that will be executed until it is garbage collected or removed by clearing the returned Reference.
NOTE: It is the responsibility of code that adds a listener via this method to clear this listener when completed.
// add a TimerListener Reference<TimerListener> listener = HystrixTimer.getInstance().addTimerListener(listenerImpl); // sometime later, often in a thread shutdown, request cleanup, servlet filter or something similar the listener must be shutdown via the clear() method listener.clear();
listener - TimerListener implementation that will be triggered according to its getIntervalTimeInMilliseconds() method implementation.
clear() method
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||