コード例 #1
0
        public int Subscribe <TMessage> (Action <TMessage> client, string channelID = "")
        {
            MessageChannel <TMessage> channel = GetMessageChannel <TMessage> (channelID);
            int ticket = channel.Subscribe(client);

            return(ticket);
        }
コード例 #2
0
        public MessageChannel <TMessage> GetGenericChannel(string channelID)
        {
            MessageChannel <TMessage> channel;

            if (!Channels.TryGetValue(channelID, out channel))
            {
                Channels.Add(channelID, channel = new MessageChannel <TMessage>());
            }
            return(channel);
        }
コード例 #3
0
        public void Invoke <TMessage> (TMessage message, string channelID = "")
        {
            MessageChannel <TMessage> channel = GetMessageChannel <TMessage> (channelID);

            channel.Invoke(message);
        }
コード例 #4
0
        public void Unsubscribe <TMessage> (Action <TMessage> client, string channelID = "")
        {
            MessageChannel <TMessage> channel = GetMessageChannel <TMessage> (channelID);

            channel.LazyUnsubscribe(client);
        }
コード例 #5
0
        public void Unsubscribe <TMessage> (int ticket, string channelID = "")
        {
            MessageChannel <TMessage> channel = GetMessageChannel <TMessage> (channelID);

            channel.Unsubscribe(ticket);
        }