!str #16492 Remove closure in TickSource to make it shareable

This commit is contained in:
Patrik Nordwall 2015-01-26 14:16:57 +01:00
parent af4555ce1f
commit 631b4ca5ac
8 changed files with 37 additions and 60 deletions

View file

@ -130,13 +130,13 @@ object Source {
def apply[T](future: Future[T]): Source[T] = FutureSource(future)
/**
* Elements are produced from the tick closure periodically with the specified interval.
* Elements are emitted periodically with the specified interval.
* The tick element will be delivered to downstream consumers that has requested any elements.
* If a consumer has not requested any elements at the point in time when the tick
* element is produced it will not receive that tick element later. It will
* receive new tick elements as soon as it has requested more elements.
*/
def apply[T](initialDelay: FiniteDuration, interval: FiniteDuration, tick: () T): TickSource[T] =
def apply[T](initialDelay: FiniteDuration, interval: FiniteDuration, tick: T): TickSource[T] =
TickSource(initialDelay, interval, tick)
/**