private async void OnConnectionRestored(Exception ex) { await _connection.RestoreLatestValueForKey(_db, _key); _trace.TraceInformation("Connection restored"); Interlocked.Exchange(ref _state, State.Connected); OpenStream(0); }