Example #1
0
 /// <summary>
 /// Initializes this queue helper.
 /// </summary>
 /// <param name="reportDelegate">Method to handle incoming chat events.</param>
 public QueueHelper(QueueHelperDelegate <T> reportDelegate = null)
 {
     if (reportDelegate != null)
     {
         this.SetReportDelegate(reportDelegate);
     }
 }
Example #2
0
        /// <summary>
        /// Initializes this queue helper.
        /// </summary>
        /// <param name="reportDelegate">Method to handle incoming chat events.</param>
        public QueueHelper(QueueHelperDelegate <T> reportDelegate = null, SimpleLogger.Logger logger = null)
        {
            this.log = logger;

            if (reportDelegate != null)
            {
                this.SetReportDelegate(reportDelegate);
            }
        }
Example #3
0
 protected virtual void Dispose(bool managed)
 {
     if (!managed)
     {
         return;
     }
     this.disposed = true;
     this.incEventQueue.Dispose();
     this.reportDelegate = null;
 }
Example #4
0
        /// <summary>
        /// Defines a delegate which will be executed on the worker thread for each item in the queue.
        /// </summary>
        /// <param name="reportDelegate"></param>
        protected void SetReportDelegate(QueueHelperDelegate <T> reportDelegate, string tag = "")
        {
            if (this.disposed)
            {
                throw new ObjectDisposedException("QueueHelper");
            }
            if (this.reportDelegate != null)
            {
            }
            this.reportDelegate = reportDelegate;

            this.incEventThread = new Thread(new ThreadStart(this.EventPuller));
            this.incEventThread.IsBackground = true;
            this.incEventThread.Name         = "HandsoffHelper->EventPuller() (" + tag + ")";
            this.incEventThread.Start();
        }