/// <summary> /// Called before a <see cref="IReactInstance"/> is disposed. /// </summary> public override Task OnReactInstanceDisposeAsync() { _shuttingDown = true; _tasks.CancelAllTasks(); _client.Dispose(); return(Task.CompletedTask); }
private void Dispose(bool disposing) { if (disposing) { _httpClient?.Dispose(); } }
public void Dispose() { CloseAndFlush(); client?.Dispose(); client = null; }
/// <summary> /// /// </summary> /// <param name="disposing"></param> protected override void Dispose(bool disposing) { base.Dispose(disposing); if (disposing) { _httpClient?.Dispose(); } }
protected virtual void Dispose(bool isDisposing) { if (!isDisposing) { return; } _httpClient?.Dispose(); }
/// <summary> /// Free resources held by the sink. /// </summary> /// <param name="disposing"> /// If true, called because the object is being disposed; if false, the object is being /// disposed from the finalizer. /// </param> protected override void Dispose(bool disposing) { base.Dispose(disposing); if (disposing) { client?.Dispose(); client = null; } }
public void Dispose() { if (baseHttpClient != null) { baseHttpClient.Dispose(); } if (serviceHttpClient != null) { serviceHttpClient.Dispose(); } }
/// <summary> /// Dispose of resources being used by the CaaS API client. /// </summary> /// <param name="disposing"> /// Explicit disposal? /// </param> protected override void Dispose(bool disposing) { if (disposing) { if (_httpClient != null) { _httpClient.Dispose(); _httpClient = null; } } }
protected virtual void Dispose(bool disposing) { if (!disposing) { return; } cancellationTokenSource.Cancel(); bufferedPublisher.Dispose(); httpClient.Dispose(); }
/// <summary> /// Free resources held by the sink. /// </summary> /// <param name="disposing"> /// If true, called because the object is being disposed; if false, the object is being /// disposed from the finalizer. /// </param> protected override void Dispose(bool disposing) { base.Dispose(disposing); if (!disposing || _client == null) { return; } _client.Dispose(); _client = null; }
private bool disposedValue; // To detect redundant calls /// <summary> /// Dispose of resources used by the class. /// </summary> /// <param name="disposing">If the class is disposing managed resources.</param> protected virtual void Dispose(bool disposing) { if (disposedValue) { return; } if (disposing) { httpClient.Dispose(); } disposedValue = true; }
/// <summary> /// Dispose the <see cref="IHttpClient"/>. /// </summary> /// <param name="disposing"><code>true</code> when called from <see cref="Dispose()"/></param> protected virtual void Dispose(bool disposing) { if (!_disposedValue) { if (disposing) { if (_httpClient != null) { _httpClient.Dispose(); _httpClient = null; } } _disposedValue = true; } }
public async Task GetSchemas(IHttpClient httpClient) { // If publishing a second time, no need to get the schemas again if (jsonLinkedServiceSchema == null) { var tasks = new List <Task> { httpClient.GetAsync(linkedServiceSchema).ContinueWith(x => { jsonLinkedServiceSchema = JSchema.Parse(x.Result.Content.ReadAsStringAsync().Result, new JSchemaUrlResolver()); }), httpClient.GetAsync(configSchema).ContinueWith(x => { jsonConfigSchema = JSchema.Parse(x.Result.Content.ReadAsStringAsync().Result, new JSchemaUrlResolver()); }) }; await Task.WhenAll(tasks); // Get schema for pipelines var assembly = Assembly.GetExecutingAssembly(); var pipelineSchemaResource = "Microsoft.ADF.Deployment.AdfKeyVaultDeployment.EmbeddedResources.PipelineSchema.json"; var tableSchemaResource = "Microsoft.ADF.Deployment.AdfKeyVaultDeployment.EmbeddedResources.TableSchema.json"; using (Stream stream = assembly.GetManifestResourceStream(pipelineSchemaResource)) { using (StreamReader reader = new StreamReader(stream)) { string schemaText = reader.ReadToEnd(); jsonPipelineSchema = JSchema.Parse(schemaText, new JSchemaUrlResolver()); } } using (Stream stream = assembly.GetManifestResourceStream(tableSchemaResource)) { using (StreamReader reader = new StreamReader(stream)) { string schemaText = reader.ReadToEnd(); jsonTableSchema = JSchema.Parse(schemaText, new JSchemaUrlResolver()); } } httpClient.Dispose(); } }
protected virtual void Dispose(bool disposing) { if (_disposed) { return; } if (disposing) { if (_httpClient != null) { _httpClient.Dispose(); _httpClient = null; } } _disposed = true; }
protected override void Dispose(bool disposing) { base.Dispose(disposing); if (!disposedValue) { if (disposing) { // TODO: dispose managed state (managed objects) _socketSubscription?.Dispose(); _socket.Stop(); _socket.Dispose(); _httpClient.Dispose(); } // TODO: free unmanaged resources (unmanaged objects) and override finalizer // TODO: set large fields to null disposedValue = true; } }
/// <summary> /// Dispose of resources being used by the CaaS API client. /// </summary> /// <param name="disposing"> /// Explicit disposal? /// </param> protected override void Dispose(bool disposing) { if (disposing) { if (_clientMessageHandler != null) { _clientMessageHandler.Dispose(); _clientMessageHandler = null; } if (_httpClient != null) { _httpClient.Dispose(); _httpClient = null; } Account = null; } }
public virtual void Dispose() => HttpClient.Dispose();
public void Dispose() { client.Dispose(); }
/// <summary> /// Called before a <see cref="IReactInstance"/> is disposed. /// </summary> public override void OnReactInstanceDispose() { _shuttingDown = true; _tasks.CancelAllTasks(); _client.Dispose(); }
public void Dispose() { HttpClient?.Dispose(); }
public void Dispose() { camcgi.Dispose(); }
public virtual void Dispose() { httpClient.Dispose(); }
public void Dispose() { _httpClient.Dispose(); }
/// <summary> /// Dispose the http object once the operation is finished /// </summary> public void Dispose() => _httpClient.Dispose();
public void Send_When_No_Exception_Thrown_Should_Convert_Request_Into_Message_And_Convert_Response_Message_Into_Response() { _underTest.Send(_request).Should().BeSameAs(_response); A.CallTo(() => _httpClient.Dispose()).MustHaveHappened(Repeated.Exactly.Once); }
public void Dispose() { _messagequeue.UnsubscribeAsync(_queueId).Wait(); _client?.Dispose(); }
/// <summary> /// Called when the host is disposed. /// </summary> public void OnDestroy() { _client.Dispose(); }