Adaptive.ReactiveTrader.Messaging.Heartbeat.Start C# (CSharp) Method

Start() public method

public Start ( ) : System.Threading.Tasks.Task
return System.Threading.Tasks.Task
        public async Task Start()
        {
            var endpoint = await _broker.GetPublicEndPoint<HeartbeatDto>("status");

            _disp = _heartbeatStream.Select(
                _ =>
                    new HeartbeatDto
                    {
                        Instance = _host.InstanceID,
                        Timestamp = DateTime.Now,
                        Type = _host.ServiceType,
                        Load = _host.GetLoad()
                    })
                                    .Subscribe(endpoint);

            Log.Information("Started heartbeat for {host}", _host);
        }
    }

Usage Example

Beispiel #1
0
 protected void StartHeartBeat()
 {
     _heartbeat.Start().Wait();
 }