Sign in Go Pro


Handling Nondeterministic Requests with Dispatcher

This lesson is for PRO members.

Upgrade today to get access to all the PRO lessons.

Unlock this lesson

Up next



Enqueue is an easy way to tell MockWebServer what to return when it gets a request. However, when the incoming requests are not in a deterministic order, or when you want to derive the response based on the request, you will need to write custom login with Dispatcher.

In this lesson you will learn:

  • What happens when you try to enqueue responses for the order of incoming requests are not deterministic. -
  • How to set up a Dispatcher for MockWebServer
  • How to derive a response from the request in the Dispatcher




You could say in the video that this code is in "dispatcher" branch.
It would help the users. I took some time figuring this out.

Anyway, this course is excellent, congrats for it!

You need to go PRO to post comments.

Lessons in MockWebServer