コード例 #1
0
ファイル: Startup.cs プロジェクト: eltoby/Chatroom
        public void Configure(IApplicationBuilder app, IHostingEnvironment env, IMessageQueueHandler mqHandler)
        {
            if (env.IsDevelopment())
            {
                app.UseDeveloperExceptionPage();
            }
            else
            {
                app.UseHsts();
            }

            app.UseCors("CorsPolicy");

            app.UseAuthentication();

            app.UseHttpsRedirection();

            app.UseMvc();

            app.UseSignalR(routes =>
            {
                routes.MapHub <ChatHub>("/chat");
            });

            mqHandler.Launch();
        }
コード例 #2
0
ファイル: EntryPoint_World.cs プロジェクト: yemel/explorer
    public EntryPoint_World(IMessageQueueHandler queueHandler)
    {
        EntryPoint_World.queueHandler = queueHandler;
#if UNITY_WEBGL && !UNITY_EDITOR
        SetCallback_CreateEntity(CreateEntity);
        SetCallback_RemoveEntity(RemoveEntity);
        SetCallback_SceneReady(SceneReady);

        SetCallback_SetEntityId(SetEntityId);
        SetCallback_SetSceneId(SetSceneId);
        SetCallback_SetTag(SetTag);

        SetCallback_SetEntityParent(SetEntityParent);

        SetCallback_EntityComponentCreateOrUpdate(EntityComponentCreateOrUpdate);
        SetCallback_EntityComponentDestroy(EntityComponentDestroy);

        SetCallback_SharedComponentCreate(SharedComponentCreate);
        SetCallback_SharedComponentAttach(SharedComponentAttach);
        SetCallback_SharedComponentUpdate(SharedComponentUpdate);
        SetCallback_SharedComponentDispose(SharedComponentDispose);

        SetCallback_OpenExternalUrl(OpenExternalUrl);
        SetCallback_OpenNftDialog(OpenNftDialog);

        SetCallback_Query(Query);
#endif
    }
コード例 #3
0
        public MessageEntranceTest()
        {
            this.PlatformMessageInQueue = new PlatformMessage()
            {
                Command = new ScrapyCore.Core.Platform.Commands.Command()
                {
                    CommandCode = ScrapyCore.Core.Platform.Commands.CommandCode.Configure,
                    CommandType = ScrapyCore.Core.Platform.Commands.CommandTransfer.Random
                }
            };
            this.PlatformMessageInMemory = new PlatformMessage()
            {
                Command = new ScrapyCore.Core.Platform.Commands.Command()
                {
                    CommandCode = ScrapyCore.Core.Platform.Commands.CommandCode.HeartBeat,
                    CommandType = ScrapyCore.Core.Platform.Commands.CommandTransfer.Forward
                }
            };

            IMessageQueueHandler <PlatformMessage> messageQueueHandler = Moq.Mock.Of <IMessageQueueHandler <PlatformMessage> >();

            Moq.Mock.Get(messageQueueHandler).Setup(x => x.MessageObject).Returns(PlatformMessageInQueue);
            IMessageQueue messageQueue = Moq.Mock.Of <IMessageQueue>();

            Moq.Mock.Get(messageQueue).Setup(x => x.GetMessage <PlatformMessage>())
            .Returns(Task.FromResult(messageQueueHandler));

            messageEntrance = new MessageEntrance(messageQueue);
        }
コード例 #4
0
        public void Setup()
        {
            _messageQueueHandler = new MessageQueueHandler(Guid.Empty);

            _message = new Message
            {
                DataSize    = 1,
                ServiceSize = 1,
                Route       = new Channel[0]
            };
        }
コード例 #5
0
        private void ReplaceMessageInChannel(Channel channel, Message message,
                                             IMessageQueueHandler messageQueueHandler)
        {
            var isSuccess = TryMoveMessageToChannel(channel, message);

            messageQueueHandler.RemoveMessage(message);

            if (!isSuccess)
            {
                if (message.MessageType == MessageType.SendingRequest)
                {
                    var sender = _network.GetNodeById(message.LastTransferNodeId);
                    _messageReceiver.HandleReceivedMessage(sender, message);
                }
                else
                {
                    messageQueueHandler.AddMessageInStart(message);
                }
            }
            else
            {
                _handledMessagesInNode.Add(message);
            }
        }
コード例 #6
0
 public SportReader(IMessageQueueHandler messageQueueHandler)
 {
     leagueAndTeamsToGames =
         new ConcurrentDictionary <Tuple <string, string, string>, List <Game> >();
     this.messageQueueHandler = messageQueueHandler;
 }
コード例 #7
0
 public StorageBL(IMessageQueueHandler <Game> messageQueueHandler, IStorageRepo dbRepo)
 {
     this.messageQueueHandler = messageQueueHandler;
     this.dbRepo = dbRepo;
 }
コード例 #8
0
 /// <summary>
 /// 构造函数
 /// </summary>
 /// <param name="currentQueue">当前消息处理器</param>
 /// <param name="message">当前消息</param>
 public MessageReceivedEventArgs(IMessageQueueHandler currentQueue, IMessage message)
 {
     Handler = currentQueue;
     Message = message;
 }
コード例 #9
0
ファイル: SoccerReader.cs プロジェクト: zaalgol/Scraper
 public SoccerReader(IMessageQueueHandler messageQueueHandler) : base(messageQueueHandler)
 {
     sportType = SportType.Soccer;
 }