Last active
October 25, 2017 11:28
-
-
Save push-gists/16098f2d32bcff0e62d20bd966d33aba to your computer and use it in GitHub Desktop.
Creating a Time Series Topic with a specification and subscribing to it. The specification determines how many events the topic retains and how many are received when the topic is subscribed to.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var createTopic = function(topicPath){ | |
var specification = new diffusion.topics.TopicSpecification( diffusion.topics.TopicType.TIME_SERIES, { | |
TIME_SERIES_EVENT_VALUE_TYPE : "json", | |
TIME_SERIES_SUBSCRIPTION_RANGE : "limit 30000", | |
TIME_SERIES_RETAINED_RANGE : "limit 30000" | |
}); | |
session.topics.add(topicPath, specification); | |
session.subscribe(topicPath); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment