Exemplo n.º 1
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="state"></param>
        /// <returns></returns>
        protected override void ProcessNextItem(AggregateState <TAggState> state)
        {
            state.ready = false;
            var item = Stream.GetPayload(state.i);
            var sync = Stream.GetSyncTime(state.i);

            if (state.syncTime < sync)
            {
                state.syncTime  = sync;
                state.prevState = state.curState;
                state.curState  = Initialize();
                state.ready     = true;
            }

            state.curState = Acc(state.curState, sync, item);
        }
Exemplo n.º 2
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="state"></param>
 /// <returns></returns>
 protected override TResult _GetPayload(AggregateState <TAggState> state) => Res(state.prevState);
Exemplo n.º 3
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="state"></param>
 /// <returns></returns>
 protected override bool _IsReady(AggregateState <TAggState> state) => Stream.IsReady(state.i) && state.ready;