I'm working on porting over some Reactive Extension queries to StreamInsight but have run into an issue with an overlapping window query.
I have a source setup in my StreamInsight server and I'm trying to write an overlapping window query like this:
var source = streamInsightServer.GetObservable<EventPattern<MyEventArg>>("EventSource");
var query = source.Window(new TimeSpan(0, 0, 1), new TimeSpan(0, 0, 0, 250));
where source is IQbservable<EventPattern<MyEventArg>> and query is then IQbservable<IObserverable<EventPattern<MyEventArg>>>
With Reactive the observer was created as follows:
_observer = query.Subscribe(evts =>
{
evts.Count().Subscribe(c =>
{
//push output here
});
});
How can I attach an observer to retrieve the equivalent output from StreamInsight?
Okay, so I've managed to create two sinks that achieve the same output as the Rx subscribtions as follows:
To note though the
.Void()method is simply an extension method that does nothing and returns void which causes the expression to be interpreted as anActioninstead of aFuncto match the required signature. Also, all bindings created by running the inner sink are NOT disposed of and build up; these can be seen in the StreamInsight Event FLow Debugger.While this achieves the same results I am not sure it qualifies as a good solution due to the extension method hack and not disposing of the inner process bindings. Still looking if anyone knows how to alternatively write this without these issues!