He-Pin commented on code in PR #537:
URL: https://github.com/apache/pekko-http/pull/537#discussion_r1573170422


##########
docs/src/test/scala/docs/http/scaladsl/Http2ClientApp.scala:
##########
@@ -94,9 +91,14 @@ object Http2ClientApp extends App {
     req => {
       // create a promise of the response for each request and set it as an 
attribute on the request
       val p = Promise[HttpResponse]()
-      queue.offer(req.addAttribute(ResponsePromise.Key, ResponsePromise(p)))
+      queue.offer(req.addAttribute(ResponsePromise.Key, ResponsePromise(p))) 
match {
         // return the future response
-        .flatMap(_ => p.future)
+        case QueueOfferResult.Enqueued    => p.future
+        case QueueOfferResult.Dropped     => Future.failed(new 
RuntimeException("Queue overflowed. Try again later."))
+        case QueueOfferResult.Failure(ex) => Future.failed(ex)
+        case QueueOfferResult.QueueClosed => Future.failed(
+            new RuntimeException("Queue was closed (pool shut down) while 
running the request. Try again later."))

Review Comment:
   should be `submitting the request`



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to