-str #16393 removes timerTransform from public API

This commit is contained in:
Konrad 'ktoso' Malawski 2014-11-26 12:15:15 +01:00
parent 3df5eb3799
commit c2242ce84e
5 changed files with 12 additions and 56 deletions

View file

@ -61,6 +61,8 @@ sealed trait HttpEntity extends japi.HttpEntity {
throw new java.util.concurrent.TimeoutException(
s"HttpEntity.toStrict timed out after $timeout while still waiting for outstanding data")
}
// TODO timerTransform is meant to be replaced / rewritten, it's currently private[akka]; See https://github.com/akka/akka/issues/16393
dataBytes.timerTransform("toStrict", transformer).runWith(Sink.head)
}

View file

@ -28,12 +28,18 @@ class DslConsistencySpec extends WordSpec with Matchers {
val ignore =
Set("equals", "hashCode", "notify", "notifyAll", "wait", "toString", "getClass") ++
Set("create", "apply", "ops", "appendJava", "andThen") ++
Seq("asScala", "asJava")
Set("asScala", "asJava")
val allowMissing: Map[Class[_], Set[String]] = Map(
sFlowClass -> Set("of"),
sSourceClass -> Set("adapt", "from"),
sSinkClass -> Set("adapt"),
// TODO timerTransform is to be removed or replaced. See https://github.com/akka/akka/issues/16393
jFlowClass -> Set("timerTransform"),
jSourceClass -> Set("timerTransform"),
jSinkClass -> Set(),
sFlowGraphClass -> Set("builder"),
jFlowGraphClass Set("graph"),
jPartialFlowGraphClass Set("graph"))

View file

@ -290,33 +290,6 @@ class Flow[-In, +Out](delegate: scaladsl.Flow[In, Out]) {
def transform[U](name: String, mkStage: japi.Creator[Stage[Out, U]]): javadsl.Flow[In, U] =
new Flow(delegate.transform(name, () mkStage.create()))
/**
* Transformation of a stream, with additional support for scheduled events.
*
* For each element the [[akka.stream.TransformerLike#onNext]]
* function is invoked, expecting a (possibly empty) sequence of output elements
* to be produced.
* After handing off the elements produced from one input element to the downstream
* subscribers, the [[akka.stream.TransformerLike#isComplete]] predicate determines whether to end
* stream processing at this point; in that case the upstream subscription is
* canceled. Before signaling normal completion to the downstream subscribers,
* the [[akka.stream.TransformerLike#onTermination]] function is invoked to produce a (possibly empty)
* sequence of elements in response to the end-of-stream event.
*
* [[akka.stream.TransformerLike#onError]] is called when failure is signaled from upstream.
*
* After normal completion or error the [[akka.stream.TransformerLike#cleanup]] function is called.
*
* It is possible to keep state in the concrete [[akka.stream.Transformer]] instance with
* ordinary instance variables. The [[akka.stream.Transformer]] is executed by an actor and
* therefore you do not have to add any additional thread safety or memory
* visibility constructs to access the state from the callback methods.
*
* Note that you can use [[#transform]] if you just need to transform elements time plays no role in the transformation.
*/
def timerTransform[U](name: String, mkStage: japi.Creator[TimerTransformer[Out, U]]): javadsl.Flow[In, U] =
new Flow(delegate.timerTransform(name, () mkStage.create()))
/**
* Takes up to `n` elements from the stream and returns a pair containing a strict sequence of the taken element
* and a stream representing the remaining elements. If ''n'' is zero or negative, then this will return a pair

View file

@ -395,33 +395,6 @@ class Source[+Out](delegate: scaladsl.Source[Out]) {
def transform[U](name: String, mkStage: japi.Creator[Stage[Out, U]]): javadsl.Source[U] =
new Source(delegate.transform(name, () mkStage.create()))
/**
* Transformation of a stream, with additional support for scheduled events.
*
* For each element the [[akka.stream.TransformerLike#onNext]]
* function is invoked, expecting a (possibly empty) sequence of output elements
* to be produced.
* After handing off the elements produced from one input element to the downstream
* subscribers, the [[akka.stream.TransformerLike#isComplete]] predicate determines whether to end
* stream processing at this point; in that case the upstream subscription is
* canceled. Before signaling normal completion to the downstream subscribers,
* the [[akka.stream.TransformerLike#onTermination]] function is invoked to produce a (possibly empty)
* sequence of elements in response to the end-of-stream event.
*
* [[akka.stream.TransformerLike#onError]] is called when failure is signaled from upstream.
*
* After normal completion or error the [[akka.stream.TransformerLike#cleanup]] function is called.
*
* It is possible to keep state in the concrete [[akka.stream.TimerTransformer]] instance with
* ordinary instance variables. The [[akka.stream.TimerTransformer]] is executed by an actor and
* therefore you do not have to add any additional thread safety or memory
* visibility constructs to access the state from the callback methods.
*
* Note that you can use [[#transform]] if you just need to transform elements time plays no role in the transformation.
*/
def timerTransform[U](name: String, mkStage: japi.Creator[TimerTransformer[Out, U]]): javadsl.Source[U] =
new Source(delegate.timerTransform(name, () mkStage.create()))
/**
* Takes up to `n` elements from the stream and returns a pair containing a strict sequence of the taken element
* and a stream representing the remaining elements. If ''n'' is zero or negative, then this will return a pair

View file

@ -364,6 +364,8 @@ trait FlowOps[+Out] {
}
/**
* INTERNAL API - meant for removal / rewrite. See https://github.com/akka/akka/issues/16393
*
* Transformation of a stream, with additional support for scheduled events.
*
* For each element the [[akka.stream.TransformerLike#onNext]]
@ -387,7 +389,7 @@ trait FlowOps[+Out] {
*
* Note that you can use [[#transform]] if you just need to transform elements time plays no role in the transformation.
*/
def timerTransform[U](name: String, mkStage: () TimerTransformer[Out, U]): Repr[U] =
private[akka] def timerTransform[U](name: String, mkStage: () TimerTransformer[Out, U]): Repr[U] =
andThen(TimerTransform(mkStage.asInstanceOf[() TimerTransformer[Any, Any]], name))
/** INTERNAL API */