+str - Renames SynchronousPublisherFromIterable to SynchronousIterablePublisher

Introduces an Actor-based IterablePublisher
       Gives names to most of the publishers
This commit is contained in:
Viktor Klang 2014-11-17 22:50:15 +01:00
parent db4e5c4a29
commit 14afce31ef
24 changed files with 688 additions and 317 deletions

View file

@ -54,7 +54,7 @@ private[http] object StreamUtils {
}
def failedPublisher[T](ex: Throwable): Publisher[T] =
impl.ErrorPublisher(ex).asInstanceOf[Publisher[T]]
impl.ErrorPublisher(ex, "failed").asInstanceOf[Publisher[T]]
def mapErrorTransformer[T](f: Throwable Throwable): Transformer[T, T] =
new Transformer[T, T] {
@ -167,7 +167,7 @@ private[http] object StreamUtils {
ref ! ExposedPublisher(publisher.asInstanceOf[impl.ActorPublisher[Any]])
(publisher, ())
} else (ErrorPublisher(new IllegalStateException("One time source can only be instantiated once")).asInstanceOf[Publisher[ByteString]], ())
} else (ErrorPublisher(new IllegalStateException("One time source can only be instantiated once"), "failed").asInstanceOf[Publisher[ByteString]], ())
}
}
@ -183,7 +183,7 @@ private[http] object StreamUtils {
override def isActive: Boolean = true
override def create(materializer: ActorBasedFlowMaterializer, flowName: String): (Publisher[T], Unit) =
if (!getAndSet(true)) (original.create(materializer, flowName)._1, ())
else (ErrorPublisher(new IllegalStateException("One time source can only be instantiated once")).asInstanceOf[Publisher[T]], ())
else (ErrorPublisher(new IllegalStateException("One time source can only be instantiated once"), "failed").asInstanceOf[Publisher[T]], ())
}
}
}

View file

@ -16,7 +16,7 @@ import akka.actor.{ Status, ActorSystem }
import akka.io.IO
import akka.testkit.TestProbe
import akka.stream.FlowMaterializer
import akka.stream.impl.SynchronousPublisherFromIterable
import akka.stream.impl.SynchronousIterablePublisher
import akka.stream.testkit.StreamTestKit
import akka.stream.testkit.StreamTestKit.{ PublisherProbe, SubscriberProbe }
import akka.stream.scaladsl._

View file

@ -17,7 +17,7 @@ import akka.http.model.headers._
import akka.http.util._
import akka.stream.scaladsl._
import akka.stream.FlowMaterializer
import akka.stream.impl.SynchronousPublisherFromIterable
import akka.stream.impl.SynchronousIterablePublisher
import HttpEntity._
import HttpMethods._

View file

@ -18,7 +18,7 @@ import akka.http.util._
import akka.util.ByteString
import akka.stream.scaladsl._
import akka.stream.FlowMaterializer
import akka.stream.impl.SynchronousPublisherFromIterable
import akka.stream.impl.SynchronousIterablePublisher
import HttpEntity._
class ResponseRendererSpec extends FreeSpec with Matchers with BeforeAndAfterAll {