Package com.couchbase.client.core
Class Timer
- java.lang.Object
-
- com.couchbase.client.core.Timer
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static Timer
create()
Creates a newTimer
with default values.static Timer
createAndStart()
Creates and starts a timer with default values.void
register(Request<Response> request)
Registers the given request to be tracked with its timeout value.com.couchbase.client.core.deps.io.netty.util.Timeout
schedule(Runnable callback, Duration runAfter)
Schedule an arbitrary task for this timer.long
scheduledTasks()
Returns the number of currently scheduled tasks.void
start()
Starts this timer.void
stop()
Stops this timer.
-
-
-
Method Detail
-
create
public static Timer create()
Creates a newTimer
with default values.- Returns:
- the created timer.
-
createAndStart
public static Timer createAndStart()
Creates and starts a timer with default values.- Returns:
- the created and started timer.
-
schedule
@Internal public com.couchbase.client.core.deps.io.netty.util.Timeout schedule(Runnable callback, Duration runAfter)
Schedule an arbitrary task for this timer.
-
register
@Internal public void register(Request<Response> request)
Registers the given request to be tracked with its timeout value.- Parameters:
request
- the request to track.
-
scheduledTasks
public long scheduledTasks()
Returns the number of currently scheduled tasks.- Returns:
- the number of scheduled tasks.
-
start
public void start()
Starts this timer.
-
stop
public void stop()
Stops this timer.
-
-