Closed abdulazizali77 closed 5 years ago
Correct, this is currently not a built-in feature. dataSourceFactory
wraps most of the common functionality to make it easier to build new data sources, but it only supports a single data update unless you use the timer.
You can implement a Data Source from scratch, and basically just open a web socket that connects to the server, receives events, and whenever the data events occur, calls $rootScope.$broadcast('dataSource:' + options.name + ':data', ....)
.
An easier implementation would be to add a custom Script that uses a web socket to collect server-side events into a global variable. Then have a JavaScript Data Source with a short refresh timer that periodically broadcasts the collected data. It would be slightly buffered and inefficient if the refresh is too frequent, but depending on event frequency that might be sufficient.
Thanks for the reply @baumandm,
yeah im actually trying the first $rootScope.$broadcast
option still figuring out why the widgets arent updating and i did think the second option would be my best bet if i couldnt get the first option to work
@baumandm oh one option which looks interesting is cyclotronDataService
buckets, but guessing bucket
s are meant to be used as adhoc data placeholders only, they dont connect to the real datastore that the widgets use?
couldnt actually find anything/other examples aside from the annotation chart using this feature
cyclotronDataService
is lightweight storage of data within Cyclotron itself. You could push events to it and have a Data Source pull it out, but it would still be a pull model instead of a push. There is some information about it at /help?q=CyclotronData
Hi,
Were trying to create a dataSource using SSE / data push, but guessing that its not supported, what we see is that there is no API to update data directly eg
dataSourceFactory.broadcastData(newDataSet)
and all of the data sources do a polling data pull by starting runner on each interval, or maybe were mising something, havent looked at usingdataService
nor looking at the$rootScope
yet, can you confirm our doubts?If we wanted to integrate SSE/ data push, what would you recommend is the best way as an interface in
dataSourceFactory
?