-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
=str akka#16959: MapAsync and MapAsyncUnordered should not ignore cancel
added TCK verification as well
- Loading branch information
Endre Sándor Varga
committed
Feb 27, 2015
1 parent
fbe80f2
commit 38df267
Showing
5 changed files
with
66 additions
and
2 deletions.
There are no files selected for viewing
34 changes: 34 additions & 0 deletions
34
akka-stream-tck/src/test/scala/akka/stream/tck/MapAsyncTest.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
/** | ||
* Copyright (C) 2014 Typesafe Inc. <http://www.typesafe.com> | ||
*/ | ||
package akka.stream.tck | ||
|
||
import java.util.concurrent.atomic.AtomicInteger | ||
|
||
import akka.stream.scaladsl.{ Flow, OperationAttributes } | ||
import akka.stream.{ ActorFlowMaterializer, ActorFlowMaterializerSettings } | ||
import org.reactivestreams.{ Processor, Publisher } | ||
|
||
import scala.concurrent.Future | ||
|
||
class MapAsyncTest extends AkkaIdentityProcessorVerification[Int] { | ||
|
||
val processorCounter = new AtomicInteger | ||
|
||
override def createIdentityProcessor(maxBufferSize: Int): Processor[Int, Int] = { | ||
val settings = ActorFlowMaterializerSettings(system) | ||
.withInputBuffer(initialSize = maxBufferSize / 2, maxSize = maxBufferSize) | ||
|
||
implicit val materializer = ActorFlowMaterializer(settings)(system) | ||
|
||
processorFromFlow( | ||
Flow[Int].mapAsync(Future.successful).withAttributes(OperationAttributes.name("identity"))) | ||
} | ||
|
||
override def createHelperPublisher(elements: Long): Publisher[Int] = { | ||
implicit val mat = ActorFlowMaterializer()(system) | ||
|
||
createSimpleIntPublisher(elements)(mat) | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters