=str #25045 adding Java/Scala interop to SourceQueue and SinkQueue

adding MiMa filters

preserving binary compat
This commit is contained in:
Stefano Bonetti 2018-05-14 12:11:20 +01:00 committed by Patrik Nordwall
parent 4399e499c4
commit 1ad174cf8c
11 changed files with 205 additions and 95 deletions

View file

@ -12,7 +12,7 @@ import akka.annotation.ApiMayChange
import akka.event.LoggingAdapter
import akka.japi.{ function, Pair, Util }
import akka.stream._
import akka.stream.impl.{ LinearTraversalBuilder, SourceQueueAdapter }
import akka.stream.impl.{ LinearTraversalBuilder }
import akka.util.{ ConstantFun, Timeout }
import akka.util.JavaDurationConverters._
import akka.{ Done, NotUsed }
@ -403,7 +403,7 @@ object Source {
}
/**
* Creates a `Source` that is materialized as an [[akka.stream.javadsl.SourceQueue]].
* Creates a `Source` that is materialized as an [[akka.stream.javadsl.SourceQueueWithComplete]].
* You can push elements to the queue and they will be emitted to the stream if there is demand from downstream,
* otherwise they will be buffered until request for demand is received. Elements in the buffer will be discarded
* if downstream is terminated.
@ -412,7 +412,7 @@ object Source {
* there is no space available in the buffer.
*
* Acknowledgement mechanism is available.
* [[akka.stream.javadsl.SourceQueue.offer]] returns `CompletionStage<QueueOfferResult>` which completes with
* [[akka.stream.javadsl.SourceQueueWithComplete.offer]] returns `CompletionStage<QueueOfferResult>` which completes with
* `QueueOfferResult.enqueued` if element was added to buffer or sent downstream. It completes with
* `QueueOfferResult.dropped` if element was dropped. Can also complete with `QueueOfferResult.Failure` -
* when stream failed or `QueueOfferResult.QueueClosed` when downstream is completed.
@ -420,7 +420,7 @@ object Source {
* The strategy [[akka.stream.OverflowStrategy.backpressure]] will not complete last `offer():CompletionStage`
* call when buffer is full.
*
* You can watch accessibility of stream with [[akka.stream.javadsl.SourceQueue.watchCompletion]].
* You can watch accessibility of stream with [[akka.stream.javadsl.SourceQueueWithComplete.watchCompletion]].
* It returns a future that completes with success when this operator is completed or fails when stream is failed.
*
* The buffer can be disabled by using `bufferSize` of 0 and then received message will wait
@ -433,7 +433,7 @@ object Source {
* @param overflowStrategy Strategy that is used when incoming elements cannot fit inside the buffer
*/
def queue[T](bufferSize: Int, overflowStrategy: OverflowStrategy): Source[T, SourceQueueWithComplete[T]] =
new Source(scaladsl.Source.queue[T](bufferSize, overflowStrategy).mapMaterializedValue(new SourceQueueAdapter(_)))
new Source(scaladsl.Source.queue[T](bufferSize, overflowStrategy).mapMaterializedValue(_.asJava))
/**
* Start a new `Source` from some resource which can be opened, read and closed.