Пример #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()));
 }