-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3 from dotnet-campus/app
支持更多业务接入
- Loading branch information
Showing
13 changed files
with
150 additions
and
138 deletions.
There are no files selected for viewing
6 changes: 3 additions & 3 deletions
6
src/dotnetCampus.ApplicationStartupManager/IStartupContext.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,12 @@ | ||
using System.Threading.Tasks; | ||
using dotnetCampus.Configurations; | ||
//using dotnetCampus.Configurations; | ||
|
||
namespace dotnetCampus.ApplicationStartupManager | ||
{ | ||
public interface IStartupContext | ||
{ | ||
IAppConfigurator Configs { get; } | ||
Task<string> ReadCacheAsync(string key, string @default = ""); | ||
//IAppConfigurator Configs { get; } | ||
//Task<string> ReadCacheAsync(string key, string @default = ""); | ||
Task WaitStartupTaskAsync(string startupKey); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
src/dotnetCampus.ApplicationStartupManager/NullObjectStartup.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 12 additions & 12 deletions
24
src/dotnetCampus.ApplicationStartupManager/StartupContext.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,37 +1,37 @@ | ||
using System; | ||
using System.Threading.Tasks; | ||
using dotnetCampus.Configurations; | ||
using dotnetCampus.Configurations.Core; | ||
//using dotnetCampus.Configurations; | ||
//using dotnetCampus.Configurations.Core; | ||
|
||
namespace dotnetCampus.ApplicationStartupManager | ||
{ | ||
internal class StartupContext : IStartupContext | ||
{ | ||
public IStartupLogger Logger { get; } | ||
|
||
public FileConfigurationRepo Configuration { get; } | ||
//public FileConfigurationRepo Configuration { get; } | ||
|
||
public IAppConfigurator Configs { get; } | ||
//public IAppConfigurator Configs { get; } | ||
|
||
public Func<Exception, Task> FastFail { get; } | ||
|
||
private readonly Func<string, Task> _waitStartupTaskAsync; | ||
|
||
public Task<string> ReadCacheAsync(string key, string @default = "") | ||
{ | ||
return Configuration.TryReadAsync(key, @default); | ||
} | ||
//public Task<string> ReadCacheAsync(string key, string @default = "") | ||
//{ | ||
// return Configuration.TryReadAsync(key, @default); | ||
//} | ||
|
||
Task IStartupContext.WaitStartupTaskAsync(string startupKey) => _waitStartupTaskAsync(startupKey); | ||
|
||
public StartupContext(IStartupLogger logger, FileConfigurationRepo configuration, | ||
public StartupContext(IStartupLogger logger, /*FileConfigurationRepo configuration,*/ | ||
Func<Exception, Task> fastFailAction, Func<string, Task> waitStartupAsync) | ||
{ | ||
Logger = logger; | ||
Configuration = configuration; | ||
//Configuration = configuration; | ||
_waitStartupTaskAsync = waitStartupAsync; | ||
Configs = configuration.CreateAppConfigurator(); | ||
FastFail = fastFailAction ?? (exception => StartupTask.CompletedTask); | ||
//Configs = configuration.CreateAppConfigurator(); | ||
FastFail = fastFailAction ?? (exception => StartupTaskBase.CompletedTask); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.