/// <summary>
 /// Called before a <see cref="IReactInstance"/> is disposed.
 /// </summary>
 public override Task OnReactInstanceDisposeAsync()
 {
     _shuttingDown = true;
     _tasks.CancelAllTasks();
     _client.Dispose();
     return(Task.CompletedTask);
 }
Exemplo n.º 2
0
 private void Dispose(bool disposing)
 {
     if (disposing)
     {
         _httpClient?.Dispose();
     }
 }
Exemplo n.º 3
0
        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();
            }
        }
Exemplo n.º 5
0
        protected virtual void Dispose(bool isDisposing)
        {
            if (!isDisposing)
            {
                return;
            }

            _httpClient?.Dispose();
        }
Exemplo n.º 6
0
        /// <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;
            }
        }
Exemplo n.º 7
0
 public void Dispose()
 {
     if (baseHttpClient != null)
     {
         baseHttpClient.Dispose();
     }
     if (serviceHttpClient != null)
     {
         serviceHttpClient.Dispose();
     }
 }
Exemplo n.º 8
0
 /// <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();
        }
Exemplo n.º 10
0
        /// <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;
        }
Exemplo n.º 11
0
        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;
        }
Exemplo n.º 12
0
        /// <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;
            }
        }
Exemplo n.º 13
0
        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;
        }
Exemplo n.º 15
0
        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;
            }
        }
Exemplo n.º 16
0
        /// <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;
            }
        }
Exemplo n.º 17
0
 public virtual void Dispose() => HttpClient.Dispose();
Exemplo n.º 18
0
 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();
 }
Exemplo n.º 20
0
 public void Dispose()
 {
     HttpClient?.Dispose();
 }
Exemplo n.º 21
0
 public void Dispose()
 {
     camcgi.Dispose();
 }
Exemplo n.º 22
0
 public virtual void Dispose()
 {
     httpClient.Dispose();
 }
 public void Dispose()
 {
     _httpClient.Dispose();
 }
Exemplo n.º 24
0
 /// <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);
        }
Exemplo n.º 26
0
 public void Dispose()
 {
     _messagequeue.UnsubscribeAsync(_queueId).Wait();
     _client?.Dispose();
 }
Exemplo n.º 27
0
 /// <summary>
 /// Called when the host is disposed.
 /// </summary>
 public void OnDestroy()
 {
     _client.Dispose();
 }