Esempio n. 1
0
        public void SendToAllOtherBackups(int segment,
                                          IExtendedRequest[] requests)
        {
            var ownerSegment = Topology.GetSegment(segment);

            foreach (var otherBackup in ownerSegment
                     .PendingBackups
                     .Concat(ownerSegment.Backups)
                     .Append(ownerSegment.AssignedEndpoint)
                     .Where(x => x != endpoint))
            {
                if (otherBackup == null)
                {
                    continue;
                }
                log.DebugFormat("Sending {0} requests to backup {1}",
                                requests.Length,
                                ownerSegment.AssignedEndpoint.Async);
                queueManager.Send(otherBackup.Async,
                                  new MessagePayload
                {
                    Data = messageSerializer.Serialize(requests),
                });
            }
        }
Esempio n. 2
0
        public void SendToOwner(int segment,
                                IExtendedRequest[] requests)
        {
            var ownerSegment = Topology.GetSegment(segment);

            if (ownerSegment.AssignedEndpoint == null)
            {
                return;
            }
            log.DebugFormat("Sending {0} requests to owner {1}",
                            requests.Length,
                            ownerSegment.AssignedEndpoint.Async);
            queueManager.Send(ownerSegment.AssignedEndpoint.Async,
                              new MessagePayload
            {
                Data = messageSerializer.Serialize(requests),
            });
        }