TimeReplayableSource would allow users to pull and replay
messages from a startTime.
The typical usage is like the following, where user get startTime
from TaskContext in onStart and pull num of messages in each onNext.
User could optionally append a TimeStampFilter in case source messages
are not stored in TimeStamp order
e.g.
class UserTask(conf: Configs) extends TaskActor(conf) {
var startTime = 0L
TimeReplayableSource would allow users to pull and replay messages from a startTime.
The typical usage is like the following, where user get startTime from TaskContext in onStart and pull num of messages in each onNext. User could optionally append a TimeStampFilter in case source messages are not stored in TimeStamp order
e.g. class UserTask(conf: Configs) extends TaskActor(conf) { var startTime = 0L
override def onStart(context: TaskContext): Unit = { this.startTime = context.startTime TimeReplayableSource.setStartTime(this.startTime) }
override def onNext(msg: Message): Unit = { TimeReplayableSource.pull(num).foreach { msg => TimeStampFilter.filter(msg, this.startTime).map(output) } } }