Commit 52085b29 authored by Savorboard's avatar Savorboard

refactor.

parent b9c3a536
...@@ -25,14 +25,13 @@ namespace DotNetCore.CAP ...@@ -25,14 +25,13 @@ namespace DotNetCore.CAP
IOptions<CapOptions> options, IOptions<CapOptions> options,
IStorage storage, IStorage storage,
IApplicationLifetime appLifetime, IApplicationLifetime appLifetime,
IServiceProvider provider) IEnumerable<IProcessingServer> servers)
{ {
_logger = logger; _logger = logger;
_appLifetime = appLifetime; _appLifetime = appLifetime;
Options = options.Value; Options = options.Value;
Storage = storage; Storage = storage;
Provider = provider; Servers = servers;
Servers = Provider.GetServices<IProcessingServer>();
_cts = new CancellationTokenSource(); _cts = new CancellationTokenSource();
_ctsRegistration = appLifetime.ApplicationStopping.Register(() => _ctsRegistration = appLifetime.ApplicationStopping.Register(() =>
...@@ -55,8 +54,6 @@ namespace DotNetCore.CAP ...@@ -55,8 +54,6 @@ namespace DotNetCore.CAP
protected IEnumerable<IProcessingServer> Servers { get; } protected IEnumerable<IProcessingServer> Servers { get; }
public IServiceProvider Provider { get; private set; }
public Task BootstrapAsync() public Task BootstrapAsync()
{ {
return (_bootstrappingTask = BootstrapTaskAsync()); return (_bootstrappingTask = BootstrapTaskAsync());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment