Microsoft.R.Host.Client.Session.RSessionProvider.TestBrokerConnectionAsync C# (CSharp) Méthode

TestBrokerConnectionAsync() public méthode

public TestBrokerConnectionAsync ( string name, string path, CancellationToken cancellationToken = default(CancellationToken) ) : System.Threading.Task
name string
path string
cancellationToken System.Threading.CancellationToken
Résultat System.Threading.Task
        public async Task TestBrokerConnectionAsync(string name, string path, CancellationToken cancellationToken = default(CancellationToken)) {
            using (_disposeToken.Link(ref cancellationToken)) {
                await TaskUtilities.SwitchToBackgroundThread();

                // Create random name to avoid collision with actual broker client
                name = name + Guid.NewGuid().ToString("N");
                var brokerClient = CreateBrokerClient(name, path, cancellationToken);
                if (brokerClient == null) {
                    throw new ArgumentException(nameof(path));
                }

                using (brokerClient) {
                    await TestBrokerConnectionWithRHost(brokerClient, cancellationToken);
                }
            }
        }