public int DoWork()
        {
            int workCount = 0;

            if (CheckForClockTick())
            {
                PollServiceAdapter();
                workCount += 1;
            }

            if (null != logAdapter)
            {
                int polled = logAdapter.Poll();

                if (0 == polled)
                {
                    if (logAdapter.IsDone())
                    {
                        CheckPosition(logAdapter.Position(), activeLogEvent);
                        logAdapter.Dispose();
                        logAdapter = null;
                    }
                }

                workCount += polled;
            }

            return(workCount);
        }
Beispiel #2
0
        public int DoWork()
        {
            int workCount = 0;

            if (CheckForClockTick())
            {
                PollServiceAdapter();
                workCount += 1;
            }

            if (null != logAdapter)
            {
                int polled = logAdapter.Poll();

                if (0 == polled)
                {
                    if (logAdapter.IsConsumed(aeron.CountersReader()))
                    {
                        _consensusModuleProxy.Ack(logAdapter.Position(), ackId++, serviceId);
                        logAdapter.Dispose();
                        logAdapter = null;
                    }
                    else if (logAdapter.IsImageClosed())
                    {
                        logAdapter.Dispose();
                        logAdapter = null;
                    }
                }

                workCount += polled;
            }

            return(workCount);
        }