Пример #1
0
 public void AddCallback(Callback callback)
 {
     lock (this)
     {
         this.callbackQueue.Add(callback);
     }
 }
Пример #2
0
        /// <summary>
        /// Passes the given message to the callback sink (wrapped up in a context) 
        /// </summary>
        /// <param name="message">the message to processs</param>
        private void TickProcess(Callback callback)
        {
            try
            {
                if (callback != null)
                {
                    callback.Call();

                    if (log.IsDebugEnabled)
                    {
                        if (callback.Time != null)
                        {
                            log.Debug("PROCESS TSO [time = " + callback.Time + "] " + callback);
                        }
                        else
                        {
                            log.Debug("PROCESS RO " + callback);
                        }
                    }
                }
            }
            catch (Exception e)
            {
                if (log.IsErrorEnabled)
                    log.Error("FAILURE Exception encountered while processing callback:" + e);
            }
        }