[Hackathon-list] Detecting when a historic stream has finished and switching to realtime events

Chris Amin camin at ripe.net
Sat Mar 28 16:04:44 CET 2015


Just had this question, so I'll share the answer here because it isn't
yet documented properly:

If you want to stream historic results at an accelerated speed, and then
when you get to the present time switch to the live stream, you have to
do the following:

1. subscribe to the stream with startTime (and optionally stopTime) set,
and speed set to something more than 1.0
2. wait for the replay to finish, and then re-subscribe to the live
stream without time parameters

e.g.:

socket.on('atlas_replay_finished', function(params) {
	// params are what you used to subscribe
	console.log('Stream finished:', params);
	// Subscribe to the live stream
	socket.emit('atlas_subscribe', {stream_type: 'probestatus'});
});

// Subscribe to a stream for a historic interval at x12 speed
socket.emit('atlas_subscribe', {stream_type: 'probestatus', startTime:
1427551200, stopTime: 1427551300, speed: 12});

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 2713 bytes
Desc: S/MIME Cryptographic Signature
URL: <https://lists.ripe.net/ripe/mail/archives/hackathon-list/attachments/20150328/bdd978aa/attachment.p7s>


More information about the Hackathon-list mailing list