NServiceBus.AcceptanceTesting.Support.EndpointRunner.Start C# (CSharp) Method

Start() public method

public Start ( CancellationToken token ) : Task
token System.Threading.CancellationToken
return Task
        public async Task Start(CancellationToken token)
        {
            try
            {
                endpointInstance = await startable.Start().ConfigureAwait(false);

                if (token.IsCancellationRequested)
                {
                    throw new OperationCanceledException("Endpoint start was aborted");
                }
            }
            catch (Exception ex)
            {
                Logger.Error("Failed to start endpoint " + configuration.EndpointName, ex);

                throw;
            }
        }

Usage Example

Example #1
0
        static async Task StartEndpoint(EndpointRunner endpoint, CancellationTokenSource cts)
        {
            var token = cts.Token;

            try
            {
                await endpoint.Start(token).ConfigureAwait(false);
            }
            catch (Exception ex)
            {
                cts.Cancel();
                throw new ScenarioException("Endpoint failed to start", ex);
            }
        }
All Usage Examples Of NServiceBus.AcceptanceTesting.Support.EndpointRunner::Start