Package io.fabric8.mockwebserver.http
Class QueueDispatcher
- java.lang.Object
-
- io.fabric8.mockwebserver.http.Dispatcher
-
- io.fabric8.mockwebserver.http.QueueDispatcher
-
public class QueueDispatcher extends Dispatcher
Compatibility layer for OkHttp.
-
-
Constructor Summary
Constructors Constructor Description QueueDispatcher()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description MockResponsedispatch(RecordedRequest request)Returns a response to satisfyrequest.voidenqueueResponse(MockResponse response)QueueDispatchersetFailFastResponse(MockResponse response)voidshutdown()Release any resources held by this dispatcher.
-
-
-
Method Detail
-
dispatch
public MockResponse dispatch(RecordedRequest request)
Returns a response to satisfyrequest. This method may block (for instance, to wait on a CountdownLatch).- Specified by:
dispatchin classDispatcher
-
shutdown
public void shutdown()
Release any resources held by this dispatcher. Any requests that are currently being dispatched should return immediately. Responses returned after shutdown will not be transmitted: their socket connections have already been closed.- Overrides:
shutdownin classDispatcher
-
enqueueResponse
public final void enqueueResponse(MockResponse response)
-
setFailFastResponse
public final QueueDispatcher setFailFastResponse(MockResponse response)
-
-