The single-request-in-actor-example does not consume the response in where the status code is not OK. Although this is unlikely to cause backpressure issues as the response is likely to have a HttpEntity.Strict entity, the example is confusing as it does not follow the warning about always consuming the response.
This commit is contained in:
parent
57fdc758ce
commit
ac8c4dc1b1
5 changed files with 47 additions and 44 deletions
|
|
@ -207,8 +207,9 @@ class HttpClientExampleSpec extends WordSpec with Matchers with CompileOnlySpec
|
|||
def receive = {
|
||||
case HttpResponse(StatusCodes.OK, headers, entity, _) =>
|
||||
log.info("Got response, body: " + entity.dataBytes.runFold(ByteString(""))(_ ++ _))
|
||||
case HttpResponse(code, _, _, _) =>
|
||||
case resp @ HttpResponse(code, _, _, _) =>
|
||||
log.info("Request failed, response code: " + code)
|
||||
resp.discardEntityBytes()
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue