=str #15755 #15756 correct variance annotations

- make HasNoX into pure marker traits
- make materialization type-safe
- remove casting when using EmptyPublisher
This commit is contained in:
Roland Kuhn 2014-09-01 21:17:23 +02:00
parent 0046bebdfe
commit 5ba32ccc50
7 changed files with 97 additions and 121 deletions

View file

@ -76,13 +76,13 @@ private[akka] object Ast {
final case class IteratorPublisherNode[I](iterator: Iterator[I]) extends PublisherNode[I] {
final def createPublisher(materializer: ActorBasedFlowMaterializer, flowName: String): Publisher[I] =
if (iterator.isEmpty) EmptyPublisher.asInstanceOf[Publisher[I]]
if (iterator.isEmpty) EmptyPublisher[I]
else ActorPublisher[I](materializer.actorOf(IteratorPublisher.props(iterator, materializer.settings),
name = s"$flowName-0-iterator"))
}
final case class IterablePublisherNode[I](iterable: immutable.Iterable[I]) extends PublisherNode[I] {
def createPublisher(materializer: ActorBasedFlowMaterializer, flowName: String): Publisher[I] =
if (iterable.isEmpty) EmptyPublisher.asInstanceOf[Publisher[I]]
if (iterable.isEmpty) EmptyPublisher[I]
else ActorPublisher[I](materializer.actorOf(IterablePublisher.props(iterable, materializer.settings),
name = s"$flowName-0-iterable"), Some(iterable))
}