コード例 #1
0
 public Task StartAsync(CancellationToken cancellationToken)
 {
     return(Task.Factory.StartNew(() =>
     {
         GrpcServiceManager.Start(GrpcExampleService.BindService(_grpcServiceBase), _tracer);
     }, cancellationToken));
 }
コード例 #2
0
ファイル: MainService.cs プロジェクト: zxzxzxzxzxtb/core-grpc
        public void Start(string serviceName)
        {
            // LogHelper.LogInfo($"{serviceName}服务启动");
            // autofac
            var container = AutofacContainer.Register();

            // grpc
            GrpcServiceManager.Start(GrpcExampleService.BindService(new GrpcExampleServiceImpl(container)), new ConsoleTracer(), whenException: (ex) =>
            {
            });
        }
コード例 #3
0
 public Task StartAsync(CancellationToken cancellationToken)
 {
     return(Task.Factory.StartNew(() =>
     {
         GrpcServiceManager.Start(GrpcExampleService.BindService(_grpcServiceBase), (grpcOptions) =>
         {
             grpcOptions.Tracer = _tracer;
             grpcOptions.GenServiceId = null;
         });
     }, cancellationToken));
 }