示例#1
0
        public void AttachInputMessage(PqlMessage requestMessage, IDataEngine engine, IPqlClientSecurityContext authContext)
        {
            if (requestMessage == null)
            {
                throw new ArgumentNullException("requestMessage");
            }

            if (engine == null)
            {
                throw new ArgumentNullException("engine");
            }

            if (authContext == null)
            {
                throw new ArgumentNullException("authContext");
            }

            AssertIsClean();

            ClauseEvaluationContext = new ClauseEvaluationContext();

            m_authContext             = authContext;
            m_requestMessage          = requestMessage;
            m_engine                  = engine;
            m_cancellationTokenSource = new CancellationTokenSource();

            // re-initialize the ring, for fault tolerance in case if previous processor fails to release items
            m_buffersRing = new DataRing <RequestExecutionBuffer>(m_buffersRingItems.Length, m_buffersRingItems.Length);
            foreach (var item in m_buffersRingItems)
            {
                // make all buffers available to producer
                m_buffersRing.AddTaskForProcessing(item, m_cancellationTokenSource.Token);
            }
        }
        public void AttachInputMessage(PqlMessage requestMessage, IDataEngine engine, IPqlClientSecurityContext authContext)
        {
            if (requestMessage == null)
            {
                throw new ArgumentNullException("requestMessage");
            }

            if (engine == null)
            {
                throw new ArgumentNullException("engine");
            }

            if (authContext == null)
            {
                throw new ArgumentNullException("authContext");
            }

            AssertIsClean();

            ClauseEvaluationContext = new ClauseEvaluationContext();

            m_authContext = authContext;
            m_requestMessage = requestMessage;
            m_engine = engine;
            m_cancellationTokenSource = new CancellationTokenSource();

            // re-initialize the ring, for fault tolerance in case if previous processor fails to release items
            m_buffersRing = new DataRing<RequestExecutionBuffer>(m_buffersRingItems.Length, m_buffersRingItems.Length);
            foreach (var item in m_buffersRingItems)
            {
                // make all buffers available to producer
                m_buffersRing.AddTaskForProcessing(item, m_cancellationTokenSource.Token);
            }
        }