+str #15080 Add tick producer
This commit is contained in:
parent
94e99c03e1
commit
2493a3fc91
6 changed files with 285 additions and 0 deletions
|
|
@ -21,6 +21,7 @@ import akka.actor.ExtendedActorSystem
|
|||
import akka.actor.ActorSystem
|
||||
import akka.actor.Extension
|
||||
import akka.stream.actor.ActorConsumer
|
||||
import scala.concurrent.duration.FiniteDuration
|
||||
|
||||
/**
|
||||
* INTERNAL API
|
||||
|
|
@ -108,6 +109,11 @@ private[akka] object Ast {
|
|||
name = s"$flowName-0-future"), Some(future))
|
||||
}
|
||||
}
|
||||
final case class TickProducerNode[I](interval: FiniteDuration, tick: () ⇒ I) extends ProducerNode[I] {
|
||||
def createProducer(materializer: ActorBasedFlowMaterializer, flowName: String): Producer[I] =
|
||||
new ActorProducer(materializer.context.actorOf(TickProducer.props(interval, tick, materializer.settings),
|
||||
name = s"$flowName-0-tick"))
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue