コード例 #1
0
        Event Event()
        {
            var senderId = ThisId() + "##" + HubGateway.LocalAddress();
            var eventId  = DateTime.Now.Ticks ^ ThisId();

            return(new Event(senderId, eventId, DateTime.Now));
        }
コード例 #2
0
        public override Task ActivateAsync()
        {
            hub    = HubGateway.GetLocalHub();
            buffer = new Queue <Notification>();

            RegisterTimer(Flush, null, flushPeriod, flushPeriod);
            return(TaskDone.Done);
        }
コード例 #3
0
        public Task Publish(Notification[] notifications)
        {
            if (listeners.Count > 0)
            {
                listeners.Notify(x => x.On(notifications, HubGateway.LocalHubId()));
            }

            return(TaskDone.Done);
        }
コード例 #4
0
 Task Publish(object arg)
 {
     return(HubGateway.Publish(Event()));
 }