Skip to content

Commit 1202fa6

Browse files
committed
deprecated Source.actorRef function removed
readability import
1 parent eb3152e commit 1202fa6

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

http-tests/src/test/scala/org/apache/pekko/http/scaladsl/server/ConnectionTestApp.scala

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import pekko.actor._
1818
import pekko.http.scaladsl.Http
1919
import pekko.http.scaladsl.model.{ HttpRequest, HttpResponse, Uri }
2020
import pekko.stream.scaladsl.{ Flow, Sink, Source }
21-
import pekko.stream.OverflowStrategy
21+
import pekko.stream.{ CompletionStrategy, OverflowStrategy }
2222
import com.typesafe.config.{ Config, ConfigFactory }
2323

2424
import scala.concurrent.Future
@@ -45,7 +45,16 @@ object ConnectionTestApp {
4545
val sourceActor = {
4646
// Our superPool expects (HttpRequest, Int) as input
4747
val source =
48-
Source.actorRef[(HttpRequest, Int)](10000, OverflowStrategy.dropNew).buffer(20000, OverflowStrategy.fail)
48+
Source.actorRef[(HttpRequest, Int)](
49+
{
50+
case Status.Success(s: CompletionStrategy) => s
51+
case Status.Success(_) => CompletionStrategy.Draining
52+
case Status.Success => CompletionStrategy.Draining
53+
},
54+
{ case Status.Failure(cause) => cause },
55+
10000,
56+
OverflowStrategy.dropNew)
57+
.buffer(20000, OverflowStrategy.fail)
4958
val sink = Sink.foreach[(Try[HttpResponse], Int)] {
5059
case (resp, id) => handleResponse(resp, id)
5160
}

0 commit comments

Comments
 (0)