Skip to content

Commit 387c56b

Browse files
committed
chore: use Hub
1 parent 9844a1b commit 387c56b

File tree

5 files changed

+165
-240
lines changed

5 files changed

+165
-240
lines changed

stream/src/main/scala/org/apache/pekko/stream/impl/ActorProcessor.scala

Lines changed: 1 addition & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -22,41 +22,7 @@ import pekko.stream.ActorAttributes
2222
import pekko.stream.impl.ActorSubscriberMessage.{ OnComplete, OnError, OnNext, OnSubscribe }
2323
import pekko.util.unused
2424

25-
import org.reactivestreams.{ Processor, Subscriber, Subscription }
26-
27-
/**
28-
* INTERNAL API
29-
*/
30-
@InternalApi private[pekko] object ActorProcessor {
31-
32-
def apply[I, O](impl: ActorRef): ActorProcessor[I, O] = {
33-
val p = new ActorProcessor[I, O](impl)
34-
// Resolve cyclic dependency with actor. This MUST be the first message no matter what.
35-
impl ! ExposedPublisher(p.asInstanceOf[ActorPublisher[Any]])
36-
p
37-
}
38-
}
39-
40-
/**
41-
* INTERNAL API
42-
*/
43-
@InternalApi private[pekko] class ActorProcessor[I, O](impl: ActorRef)
44-
extends ActorPublisher[O](impl)
45-
with Processor[I, O] {
46-
override def onSubscribe(s: Subscription): Unit = {
47-
ReactiveStreamsCompliance.requireNonNullSubscription(s)
48-
impl ! OnSubscribe(s)
49-
}
50-
override def onError(t: Throwable): Unit = {
51-
ReactiveStreamsCompliance.requireNonNullException(t)
52-
impl ! OnError(t)
53-
}
54-
override def onComplete(): Unit = impl ! OnComplete
55-
override def onNext(elem: I): Unit = {
56-
ReactiveStreamsCompliance.requireNonNullElement(elem)
57-
impl ! OnNext(elem)
58-
}
59-
}
25+
import org.reactivestreams.{ Subscriber, Subscription }
6026

6127
/**
6228
* INTERNAL API

stream/src/main/scala/org/apache/pekko/stream/impl/FanoutProcessor.scala

Lines changed: 0 additions & 183 deletions
This file was deleted.

stream/src/main/scala/org/apache/pekko/stream/impl/Sinks.scala

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -108,24 +108,6 @@ import org.reactivestreams.Subscriber
108108
new PublisherSink[In](attr, amendShape(attr))
109109
}
110110

111-
/**
112-
* INTERNAL API
113-
*/
114-
@InternalApi private[pekko] final class FanoutPublisherSink[In](val attributes: Attributes, shape: SinkShape[In])
115-
extends SinkModule[In, Publisher[In]](shape) {
116-
117-
override def create(context: MaterializationContext): (Subscriber[In], Publisher[In]) = {
118-
val impl = context.materializer.actorOf(context, FanoutProcessorImpl.props(context.effectiveAttributes))
119-
val fanoutProcessor = new ActorProcessor[In, In](impl)
120-
// Resolve cyclic dependency with actor. This MUST be the first message no matter what.
121-
impl ! ExposedPublisher(fanoutProcessor.asInstanceOf[ActorPublisher[Any]])
122-
(fanoutProcessor, fanoutProcessor)
123-
}
124-
125-
override def withAttributes(attr: Attributes): SinkModule[In, Publisher[In]] =
126-
new FanoutPublisherSink[In](attr, amendShape(attr))
127-
}
128-
129111
/**
130112
* INTERNAL API
131113
* Attaches a subscriber to this stream.

0 commit comments

Comments
 (0)