Package com.yahoo.jdisc
Interface TimeoutManager
public interface TimeoutManager
This interface provides a callback for when the Request.setTimeout(long, TimeUnit)
is invoked. If no such
handler is registered at the time where the target RequestHandler
is called, the default timeout manager will
be injected.
- Author:
- Simon Thoresen Hult
-
Method Summary
Modifier and TypeMethodDescriptionvoid
scheduleTimeout
(Request request) Schedule timeout management for a request.default void
unscheduleTimeout
(Request request) Unschedule timeout management for a previously scheduled request.
-
Method Details
-
scheduleTimeout
Schedule timeout management for a request. This is called by a request wheneverRequest.setTimeout(long, TimeUnit)
is invoked; this may be called multiple times for the sameRequest
.- Parameters:
request
- the request whose timeout to schedule
-
unscheduleTimeout
Unschedule timeout management for a previously scheduled request. This is called whenever a request is cancelled, and the purpose is to free up resources taken by the implementation of this associated with the request.This is only called once for a request, and only after at least one scheduleTimeout call.
The default implementation of this does nothing.
- Parameters:
request
- the previously scheduled timeout
-