Exemple #1
0
        private void SendHeartbeat()
        {
            if (shutting_down || dropletManager.IsEmpty)
            {
                return;
            }

            var heartbeats = new List<Heartbeat>();

            dropletManager.ForAllInstances((instance) =>
            {
                instance.UpdateState(GetApplicationState(instance.Staged));
                instance.StateTimestamp = Utility.GetEpochTimestamp();
                heartbeats.Add(new Heartbeat(instance));
            });

            var message = new DropletHeartbeat
            {
                Droplets = heartbeats.ToArray()
            };

            natsClient.Publish(message);
        }
Exemple #2
0
 private void SendSingleHeartbeat(Heartbeat heartbeat)
 {
     var message = new DropletHeartbeat
     {
         Droplets = new[] { heartbeat }
     };
     natsClient.Publish(message);
 }
Exemple #3
0
 private void SendSingleHeartbeat(Heartbeat heartbeat)
 {
     var message = new DropletHeartbeat
     {
         Droplets = new[] { heartbeat }
     };
     messagingProvider.Publish(message);
 }