We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
surging 分布式引擎可以支持扩展,以注册DotNetty 组件为例,继承SystemModule,如下代码
public class DotNettyModule : SystemModule { public override void Initialize(CPlatformContainer serviceProvider) { base.Initialize(serviceProvider); } /// <summary> /// Inject dependent third-party components /// </summary> /// <param name="builder"></param> protected override void RegisterBuilder(ContainerBuilderWrapper builder) { base.RegisterBuilder(builder); builder.Register(provider => { IServiceExecutor serviceExecutor = null; if (provider.IsRegistered(typeof(IServiceExecutor))) serviceExecutor = provider.Resolve<IServiceExecutor>(); return new DotNettyTransportClientFactory(provider.Resolve<ITransportMessageCodecFactory>(), provider.Resolve<ILogger<DotNettyTransportClientFactory>>(), serviceExecutor); }).As(typeof(ITransportClientFactory)).SingleInstance(); if (AppConfig.ServerOptions.Protocol == CommunicationProtocol.Tcp || AppConfig.ServerOptions.Protocol == CommunicationProtocol.None) { RegisterDefaultProtocol(builder); } } private static void RegisterDefaultProtocol(ContainerBuilderWrapper builder) { builder.Register(provider => { return new DotNettyServerMessageListener(provider.Resolve<ILogger<DotNettyServerMessageListener>>(), provider.Resolve<ITransportMessageCodecFactory>()); }).SingleInstance(); builder.Register(provider => { var serviceExecutor = provider.ResolveKeyed<IServiceExecutor>(CommunicationProtocol.Tcp.ToString()); var messageListener = provider.Resolve<DotNettyServerMessageListener>(); return new DefaultServiceHost(async endPoint => { await messageListener.StartAsync(endPoint); return messageListener; }, serviceExecutor); }).As<IServiceHost>(); } }
然后可以在项目中添加引用,也可以根据配置的rootpath 扫描加载,如下图所示
The text was updated successfully, but these errors were encountered:
No branches or pull requests
surging 分布式引擎可以支持扩展,以注册DotNetty 组件为例,继承SystemModule,如下代码
然后可以在项目中添加引用,也可以根据配置的rootpath 扫描加载,如下图所示
The text was updated successfully, but these errors were encountered: