Ejemplo n.º 1
0
 private void SendInternal(BroadcastAsyncResult ar)
 {
     foreach (Type tm in this.GetMedia())
     {
         var m = (IMedium)Activator.CreateInstance(tm);
         try
         {
             if (ar != null)
                 m.DispatchAsync(this.Message, ar);
             else
                 m.Dispatch(this.Message);
         } catch (NoticeDispatchException)
         {
             if (!MuteExceptions)
                 throw;
         }
     }
 }
Ejemplo n.º 2
0
        // Asynchronous deliver uses the application thread pool. If the application quits, remaining delivery is cancelled.
        public BroadcastAsyncResult SendAsync()
        {
            var ar = new BroadcastAsyncResult(this.GetMedia());

            DelayInternal(this.noticedelay, () => {
                SendInternal(ar);
            });

            return ar;
        }