-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a1b4cb7
commit f36992b
Showing
9 changed files
with
141 additions
and
46 deletions.
There are no files selected for viewing
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
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
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
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
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 |
---|---|---|
@@ -0,0 +1,34 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Text; | ||
using System.Threading; | ||
using System.Threading.Tasks; | ||
using Microsoft.Extensions.Hosting; | ||
using Microsoft.Extensions.Logging; | ||
|
||
namespace Study.Core.Runtime.Client | ||
{ | ||
public class RpcClientHost : IHostedService | ||
{ | ||
private readonly ILogger<RpcClientHost> _logger; | ||
|
||
public RpcClientHost(ILogger<RpcClientHost> logger) | ||
{ | ||
_logger = logger; | ||
} | ||
|
||
public Task StartAsync(CancellationToken cancellationToken) | ||
{ | ||
if (_logger.IsEnabled(LogLevel.Debug)) | ||
_logger.LogDebug("客户端程序启动"); | ||
return Task.CompletedTask; | ||
} | ||
|
||
public Task StopAsync(CancellationToken cancellationToken) | ||
{ | ||
if (_logger.IsEnabled(LogLevel.Debug)) | ||
_logger.LogDebug("客户端程序停止"); | ||
return Task.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Text; | ||
using Microsoft.Extensions.DependencyInjection; | ||
using Microsoft.Extensions.Hosting; | ||
using Study.ProxyGenerator.Implementation; | ||
|
||
namespace Study.ProxyGenerator | ||
{ | ||
public static class HostBuilderExtensions | ||
{ | ||
public static IHostBuilder AddClientProxy(this IHostBuilder builder) | ||
{ | ||
builder.ConfigureServices((context, services) => | ||
{ | ||
services.AddSingleton<IServiceProxyGenerater, ServiceProxyGenerater>(); | ||
services.AddSingleton<IServiceProxyFactory, ServiceProxyFactory>(); | ||
}); | ||
return builder; | ||
} | ||
} | ||
|
||
public static class ServiceCollectionExtensions | ||
{ | ||
public static ServiceCollection AddClientProxyServices(this ServiceCollection services) | ||
{ | ||
services.AddSingleton<IServiceProxyGenerater, ServiceProxyGenerater>(); | ||
services.AddSingleton<IServiceProxyFactory, ServiceProxyFactory>(); | ||
return services; | ||
} | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
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
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