Example #1
0
 public ScheduleTask(IChannelManager channelManager, Ukcp ukcp, IScheduleThread scheduleThread)
 {
     _imessageExecutor = ukcp.IMessageExecutor;
     _channelManager   = channelManager;
     _ukcp             = ukcp;
     _scheduleThread   = scheduleThread;
 }
Example #2
0
 /// <summary>
 /// Parameterized Constructor.
 /// </summary>
 public MessageProcessor(IMessageReceiver receiver,
     IMessageExecutor executor)
 {
     this.receiver = receiver;
     this.executor = executor;
     this.broker = MessageBrokerFactory.Instance.GetOrCreate("message");
 }
Example #3
0
        /// <summary>
        /// Parameterized Constructor.
        /// </summary>
        public MessageProcessor(string messageTypeName, IMessageQueue[] queues, IMessageExecutor <TMessage> messageExecutor,
                                IMessageStore messageStore, ITextSerializer serializer)
        {
            this._messageTypeName = messageTypeName;

            this._messageExecutor = messageExecutor;
            this._queuesCount     = queues.Length;
            this._queues          = queues;

            this._messageStore = messageStore;
            this._serializer   = serializer;

            this._taskScheduler = new LimitedConcurrencyLevelTaskScheduler(_queuesCount);
        }
Example #4
0
        public void Tick()
        {
            while (true)
            {
                if (messages.Count <= 0)
                {
                    return;
                }

                Message          msg      = messages.Dequeue();
                IMessageExecutor executor = null;
                if (executors.TryGetValue(msg.messageID, out executor))
                {
                    executor.Execute(msg);
                }
                msg.Release();
            }
        }
Example #5
0
        /**
         * Creates a new instance.
         *
         * @param output output for kcp
         */
        public Ukcp(KcpOutput output, KcpListener kcpListener, IMessageExecutor iMessageExecutor,
                    ReedSolomon reedSolomon, ChannelConfig channelConfig)
        {
            this._channelConfig    = channelConfig;
            this.kcp               = new Kcp(channelConfig.Conv, output);
            this.active            = true;
            this._kcpListener      = kcpListener;
            this._iMessageExecutor = iMessageExecutor;
            //默认2<<11   可以修改
            _writeQueue = new MpscArrayQueue <IByteBuffer>(2 << 10);
            _readQueue  = new MpscArrayQueue <IByteBuffer>(2 << 10);
            //recieveList = new SpscLinkedQueue<>();
            int headerSize = 0;

            if (channelConfig.KcpTag)
            {
                headerSize += KCP_TAG;
            }

            //init crc32
            if (channelConfig.Crc32Check)
            {
                var kcpOutput = kcp.Output;
                kcpOutput   = new Crc32OutPut(kcpOutput, headerSize);
                kcp.Output  = kcpOutput;
                headerSize += HEADER_CRC;
            }

            //init fec
            if (reedSolomon != null)
            {
                var kcpOutput = kcp.Output;
                _fecEncode  = new FecEncode(headerSize, reedSolomon, channelConfig.Mtu);
                _fecDecode  = new FecDecode(3 * reedSolomon.getTotalShardCount(), reedSolomon, channelConfig.Mtu);
                kcpOutput   = new FecOutPut(kcpOutput, _fecEncode);
                kcp.Output  = kcpOutput;
                headerSize += Fec.fecHeaderSizePlus2;
            }

            kcp.setReserved(headerSize);
            intKcpConfig(channelConfig);
        }
 public BatchConsumer(IMessageExecutor executor)
 {
     _executor = executor;
 }
Example #7
0
 public MessageBatchConsumer(IMessageExecutor executor) : base(executor)
 {
 }
Example #8
0
 public ScheduleTask(IChannelManager channelManager, Ukcp ukcp)
 {
     _imessageExecutor = ukcp.IMessageExecutor;
     _channelManager   = channelManager;
     _ukcp             = ukcp;
 }
Example #9
0
 public MessageManager(IMessageExecutor messageExecutor, IMediator mediator, IOptions <HangfireConfiguration> hangfireConfig)
 {
     _messageExecutor = messageExecutor;
     _mediator        = mediator;
     _hangfireConfig  = hangfireConfig.Value;
 }
Example #10
0
 public TaakService(IMessageExecutor commandExecutor)
 {
     this.commandExecutor = commandExecutor;
 }
Example #11
0
 public static void test()
 {
     _messageExecutor = new DistuptorMessageExecutor();
     _messageExecutor.start();
     en();
 }
 public MyBatchHandler(IMessageExecutor executor) : base(executor)
 {
 }
Example #13
0
 public void Regist(int messageID, IMessageExecutor executor)
 {
     executors.Add(messageID, executor);
 }
Example #14
0
 public TaakController(IMessageExecutor messageExecutor, ITaakDataRepository taakDataRepository)
 {
     this.messageExecutor    = messageExecutor;
     this.taakDataRepository = taakDataRepository;
 }
Example #15
0
 public ReintegratieAangemaaktEventHandler(IMessageExecutor messageExecutor)
 {
     this.messageExecutor = messageExecutor;
 }