2014-09-03 21:54:18 +02:00
|
|
|
/**
|
|
|
|
|
* Copyright (C) 2014 Typesafe Inc. <http://www.typesafe.com>
|
|
|
|
|
*/
|
|
|
|
|
package akka.stream.scaladsl2
|
|
|
|
|
|
2014-10-02 17:32:08 +02:00
|
|
|
import org.reactivestreams.Subscriber
|
2014-09-01 13:30:15 +02:00
|
|
|
|
2014-10-02 17:32:08 +02:00
|
|
|
import scala.language.implicitConversions
|
2014-09-03 21:54:18 +02:00
|
|
|
import scala.annotation.unchecked.uncheckedVariance
|
|
|
|
|
|
|
|
|
|
/**
|
2014-10-02 17:32:08 +02:00
|
|
|
* A `Sink` is a set of stream processing steps that has one open input and an attached output.
|
|
|
|
|
* Can be used as a `Subscriber`
|
2014-09-03 21:54:18 +02:00
|
|
|
*/
|
2014-10-02 17:32:08 +02:00
|
|
|
trait Sink[-In] {
|
2014-10-03 14:21:18 +02:00
|
|
|
def toSubscriber()(implicit materializer: FlowMaterializer): Subscriber[In @uncheckedVariance] =
|
|
|
|
|
Flow[In].connect(this).toSubscriber()
|
2014-09-03 21:54:18 +02:00
|
|
|
}
|