Exemplo n.º 1
0
 public override Task HandlePingAsync(PingMessage pingMessage)
 {
     if (RuntimeServicePingMessage.TryGetRebalance(pingMessage, out var target) && !string.IsNullOrEmpty(target))
     {
         var connection = CreateOnDemandServiceConnection();
         return(StartCoreAsync(connection, target));
     }
     return(Task.CompletedTask);
 }
Exemplo n.º 2
0
        public override async Task HandlePingAsync(PingMessage pingMessage)
        {
            await base.HandlePingAsync(pingMessage);

            if (RuntimeServicePingMessage.TryGetRebalance(pingMessage, out var target) && !string.IsNullOrEmpty(target))
            {
                var connection = CreateServiceConnectionCore(ServiceConnectionType.OnDemand);
                AddOnDemandConnection(connection);
                await StartCoreAsync(connection, target);
            }
        }