=str #22448 rewrite Source.empty to GraphStage

This commit is contained in:
Konrad `ktoso` Malawski 2017-03-03 15:20:37 +01:00
parent 0367812e40
commit e47dbda154
6 changed files with 115 additions and 10 deletions

View file

@ -331,11 +331,7 @@ object Source {
*/
def empty[T]: Source[T, NotUsed] = _empty
private[this] val _empty: Source[Nothing, NotUsed] =
new Source(
new PublisherSource[Nothing](
EmptyPublisher,
DefaultAttributes.emptySource,
shape("EmptySource")))
Source.fromGraph(EmptySource)
/**
* Create a `Source` which materializes a [[scala.concurrent.Promise]] which controls what element