Understanding Asynchronous I/O in Play Framework

The problem

Many web based applications invoke external web services. Network I/O involves significant amount of waiting. Waiting comes from two sources:

  • Service latency – The time it takes for the external service to complete the task.
  • Network latency – A thread doing read can wait for data to become available in the network socket. A thread doing write sometimes need to wait when the write buffer is full and can no longer accept new data.
    Continue reading