Beispiel #1
0
        public override bool EnqueueWithoutDispatch(Exception exception, Action dequeuedCallback)
        {
            TChannel local = this.EnsureChannelAvailable();

            if (local != null)
            {
                return(local.EnqueueWithoutDispatch(exception, dequeuedCallback));
            }
            SingletonChannelAcceptor <ChannelInterfaceType, TChannel, QueueItemType> .InvokeDequeuedCallback(dequeuedCallback, false);

            return(false);
        }
Beispiel #2
0
        public void Enqueue(Exception exception, Action dequeuedCallback, bool canDispatchOnThisThread)
        {
            TChannel local = this.EnsureChannelAvailable();

            if (local != null)
            {
                local.EnqueueAndDispatch(exception, dequeuedCallback, canDispatchOnThisThread);
            }
            else
            {
                SingletonChannelAcceptor <ChannelInterfaceType, TChannel, QueueItemType> .InvokeDequeuedCallback(dequeuedCallback, canDispatchOnThisThread);
            }
        }
Beispiel #3
0
        public bool EnqueueWithoutDispatch(QueueItemType item, Action dequeuedCallback)
        {
            TChannel local = this.EnsureChannelAvailable();

            if (DiagnosticUtility.ShouldTraceInformation)
            {
                this.OnTraceMessageReceived(item);
            }
            if (local != null)
            {
                return(local.EnqueueWithoutDispatch(item, dequeuedCallback));
            }
            SingletonChannelAcceptor <ChannelInterfaceType, TChannel, QueueItemType> .InvokeDequeuedCallback(dequeuedCallback, false);

            item.Dispose();
            return(false);
        }
Beispiel #4
0
        public void EnqueueAndDispatch(QueueItemType item, Action dequeuedCallback, bool canDispatchOnThisThread)
        {
            TChannel local = this.EnsureChannelAvailable();

            if (DiagnosticUtility.ShouldTraceInformation)
            {
                this.OnTraceMessageReceived(item);
            }
            if (local != null)
            {
                local.EnqueueAndDispatch(item, dequeuedCallback, canDispatchOnThisThread);
            }
            else
            {
                SingletonChannelAcceptor <ChannelInterfaceType, TChannel, QueueItemType> .InvokeDequeuedCallback(dequeuedCallback, canDispatchOnThisThread);

                item.Dispose();
            }
        }
 public PeerMessageQueueAdapter(SingletonChannelAcceptor <ChannelInterfaceType, TChannel, Message> singletonChannelAcceptor)
 {
     this.singletonChannelAcceptor = singletonChannelAcceptor;
 }