예제 #1
0
파일: Lrc.cs 프로젝트: superliujian/Sxta
 public void AddCallback(Callback callback)
 {
     lock (this)
     {
         this.callbackQueue.Add(callback);
     }
 }
예제 #2
0
파일: Lrc.cs 프로젝트: superliujian/Sxta
        /// <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);
            }
        }