+str #24229 move SinkRef / SourceRef to akka.stream
+str #24229 remove protobuf changes, which do not need to be made in this PR docs moved things config object subscription timeout confifmed working, also, attributes document attributes for sub timeout tests for the source also failing when it should additional demand test implemented protection from materializing "in cycles"; would be nice in types but that breaks the niceness of use of the types SinkRef/SourceRef... cleanup no idle timeout built in, can use the Timeout stages more docs simplest change to prevent exposing SinkRef => SourceRef => SinkRef cycle Things to decide: * is it ok to require using `getSource` / `getSink` as Java API, is there better naming? * where should the constructors go? I'd say just in regular javadsl/scaladsl `Source`/ `Sink` objects move constructors to {javadsl,scaladsl}.{Source,Sink} companion objects Remove now useless "canMaterialize" field Separate stage (implementation) from ref (wrapped actor ref) to make it clearer what is serialized Clarify that partner refs are not optional in on-the-wire interfaces minor cleanup in SourceRefStage Renamed the stages but questionable if that really helps ;) cleanups, better docs cleanup, fix docs compilation fix mima got rid of Futures in the materialized values of stream refs
This commit is contained in:
parent
bc6861f7e4
commit
7c75abbf7e
42 changed files with 2834 additions and 4386 deletions
|
|
@ -4,7 +4,8 @@
|
|||
package akka.stream.scaladsl
|
||||
|
||||
import java.util.concurrent.CompletionStage
|
||||
|
||||
import akka.util.ConstantFun
|
||||
import akka.{ Done, NotUsed }
|
||||
import akka.actor.{ ActorRef, Cancellable, Props }
|
||||
import akka.stream.actor.ActorPublisher
|
||||
import akka.stream.impl.Stages.DefaultAttributes
|
||||
|
|
@ -24,6 +25,12 @@ import scala.compat.java8.FutureConverters._
|
|||
import scala.concurrent.duration.FiniteDuration
|
||||
import scala.concurrent.{ Future, Promise }
|
||||
|
||||
import akka.stream.impl.streamref.SourceRefStageImpl
|
||||
import akka.stream.stage.{ GraphStage, GraphStageWithMaterializedValue }
|
||||
import akka.util.OptionVal
|
||||
|
||||
import scala.compat.java8.FutureConverters._
|
||||
|
||||
/**
|
||||
* A `Source` is a set of stream processing steps that has one open output. It can comprise
|
||||
* any number of internal sources and transformations that are wired together, or it can be
|
||||
|
|
@ -601,4 +608,15 @@ object Source {
|
|||
*/
|
||||
def unfoldResourceAsync[T, S](create: () ⇒ Future[S], read: (S) ⇒ Future[Option[T]], close: (S) ⇒ Future[Done]): Source[T, NotUsed] =
|
||||
Source.fromGraph(new UnfoldResourceSourceAsync(create, read, close))
|
||||
|
||||
/**
|
||||
* A local [[Sink]] which materializes a [[SourceRef]] which can be used by other streams (including remote ones),
|
||||
* to consume data from this local stream, as if they were attached in the spot of the local Sink directly.
|
||||
*
|
||||
* Adheres to [[StreamRefAttributes]].
|
||||
*
|
||||
* See more detailed documentation on [[SinkRef]].
|
||||
*/
|
||||
def sinkRef[T](): Source[T, SinkRef[T]] =
|
||||
Source.fromGraph(new SourceRefStageImpl[T](OptionVal.None))
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue