Esempio n. 1
0
        internal static bool IsConcurrent(ChannelDispatcher runtime, bool hasSession)
        {
            bool isConcurrencyModeSingle = true;

            if (ConcurrencyBehavior.SupportsTransactedBatch(runtime))
            {
                return(false);
            }

            foreach (EndpointDispatcher endpointDispatcher in runtime.Endpoints)
            {
                if (endpointDispatcher.DispatchRuntime.EnsureOrderedDispatch)
                {
                    return(false);
                }

                if (endpointDispatcher.DispatchRuntime.ConcurrencyMode != ConcurrencyMode.Single)
                {
                    isConcurrencyModeSingle = false;
                }
            }

            if (!isConcurrencyModeSingle)
            {
                return(true);
            }

            if (!hasSession)
            {
                return(true);
            }

            return(false);
        }
Esempio n. 2
0
 internal ConcurrencyBehavior(DispatchRuntime runtime)
 {
     this.concurrencyMode         = runtime.ConcurrencyMode;
     this.enforceOrderedReceive   = runtime.EnsureOrderedDispatch;
     this.supportsTransactedBatch = ConcurrencyBehavior.SupportsTransactedBatch(runtime.ChannelDispatcher);
 }