Пример #1
0
 /// <summary>
 /// Reuses the specified pipeline.
 /// </summary>
 /// <param name="application">The application.</param>
 internal void Reuse(SnmpApplication application)
 {
     lock (_root)
     {
         _queue.Enqueue(application);
     }
 }
Пример #2
0
        /// <summary>
        /// Creates a pipeline for the specified context.
        /// </summary>
        /// <param name="context">The context.</param>
        /// <returns></returns>
        public SnmpApplication Create(ISnmpContext context)
        {
            SnmpApplication result = null;

            lock (_root)
            {
                if (_queue.Count > 0)
                {
                    result = _queue.Dequeue();
                }
            }

            if (result == null)
            {
                result = new SnmpApplication(this, _logger, _store, _membershipProvider, _factory);
            }

            result.Init(context);
            return(result);
        }