SI 2.1: Access to events in the stream
Hello Sorry for my bad English. How can I get access to events that are already in the stream. I want to keep the event in the stream for a long time. Then I want to get access to events in the stream that are there.
June 22nd, 2013 10:50am

To keep them in the stream for a while, you would use AlterEventDuration.

To access them ... I'm not sure what you mean by this but I'll try to give it a shot ...

1) Use a LINQ query over the events after altering the duration.

2) Use a UDO/UDA ... this will give you all of the events in a particular window.

3) Output Adapter/Sink ... events are sent to the output adapter/sink and you can access them there.

It depends on what you are trying to do. Typically, altering your duration and then writing a LINQ query will do what you want.

Free Windows Admin Tool Kit Click here and download it now
June 22nd, 2013 2:00pm


IQStreamable<int> inputStream = application.DefineObservable(() => Observable.Range(0, 2)).ToPointStreamable(r => PointEvent<int>.CreateInsert(DateTime.UtcNow, r), AdvanceTimeSettings.StrictlyIncreasingStartTime); var oneDay = inputStream.AlterEventDuration(e => TimeSpan.FromDays(1)); var outSink = from t in oneDay select t; var mySink = application.DefineObserver(() => Observer.Create<int>(x => Console.WriteLine("Out: {0}", x))); mySink.Deploy("serverSink"); var proc = outSink.Bind(mySink).Run("serverProcess");

I tried to do it but did not work. When recalling the events are removed from the stream:

foreach (var outS in outSink.ToEnumerable())
{
   Console.WriteLine("Out: {0}", outS);
}

Out: 0
Out: 1


June 22nd, 2013 3:07pm

Can you please describe your use case and what you are trying to do here?

Since you are getting output, your stream is running. And yes, once they are output, they are out of the stream. Since you are using StrictlyIncreasingStartTime, when your Observable completes, it sends a DateTimeOffset of MaxValue ... clearing the stream out. If you write out your CTIs by using Observer.Create<IntervalEvent<int>>, you'll see the CTIs as well. Just make sure that you check the EventKind before trying to access the payload; CTIs won't have a payload.

Free Windows Admin Tool Kit Click here and download it now
June 24th, 2013 5:30pm

I'll explain what I want to do. Every second I get a few thousand events. Each new event is checked every existing event. Thereafter, the event is in the flow or removed from the stream. After that comes a new event ... And so on.
I want to keep the existing events in the stream and have access to them in a few hours, days, weeks.



July 8th, 2013 2:39am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics