-
Notifications
You must be signed in to change notification settings - Fork 8
Replay
kebetsi edited this page Feb 17, 2015
·
1 revision
The Replay component fetches data from a Persistor with a given time compression rate starting from a given timestamp initTimeMs provided in the constructor parameter ReplayConfig. The data is loaded in batches of 1 second every second multiplied by the compression rate.
The example below shows how to print Transactions from a TransactionPersistor at a 0.01 compression rate.
implicit val builder = new ComponentBuilder("ReplayFlowTesterSystem")
// Initialize the Interface to DB
val btceXactPersit = new TransactionPersistor("btce-transaction-db")
btceXactPersit.init()
// Create Components
val printer = builder.createRef(Props(classOf[Printer], "printer"), "printer")
val replayer = builder.createRef(Props(classOf[Replay[Transaction]], btceXactPersit, replayConf, implicitly[ClassTag[Transaction]]), "replayer")
// Create the connections
replayer.addDestination(printer, classOf[Transaction])
// Start the system
builder.start