Ejemplo n.º 1
0
 /// <summary>
 /// 扩展一
 /// </summary>
 /// <typeparam name="T"></typeparam>
 /// <param name="data"></param>
 /// <param name="userId"></param>
 /// <returns></returns>
 public static T Client <T>(this IGrpcClient <T> data, long userId) where T : ClientBase
 {
     return(data.CreateClient((servercallInvokers) =>
     {
         //TODO 根据userId 来选择节点
         return servercallInvokers[0];
     }));
 }
 public Worker(
     IWebApiClient webApiClient,
     IGrpcClient grpcClient,
     ILogger <Worker> logger)
 {
     _webApiClient = webApiClient;
     _grpcClient   = grpcClient;
     _logger       = logger;
 }
 public Worker(
     IWebApiClient webApiClient,
     IGrpcClient grpcClient,
     IMyConfiguration myConfiguration,
     ILogger <Worker> logger)
 {
     _webApiClient    = webApiClient;
     _grpcClient      = grpcClient;
     _myConfiguration = myConfiguration;
     _logger          = logger;
 }
Ejemplo n.º 4
0
        public EthereumRunner(IRpcModuleProvider rpcModuleProvider, IConfigProvider configurationProvider, ILogManager logManager,
                              IGrpcService grpcService, IGrpcClient grpcClient, INdmConsumerChannelManager ndmConsumerChannelManager,
                              INdmDataPublisher ndmDataPublisher, INdmInitializer ndmInitializer)
        {
            _logManager  = logManager ?? throw new ArgumentNullException(nameof(logManager));
            _grpcService = grpcService;
            _grpcClient  = grpcClient;
            _ndmConsumerChannelManager = ndmConsumerChannelManager;
            _ndmDataPublisher          = ndmDataPublisher;
            _ndmInitializer            = ndmInitializer;
            _logger = _logManager.GetClassLogger();

            InitRlp();
            _configProvider    = configurationProvider ?? throw new ArgumentNullException(nameof(configurationProvider));
            _rpcModuleProvider = rpcModuleProvider ?? throw new ArgumentNullException(nameof(rpcModuleProvider));
            _initConfig        = configurationProvider.GetConfig <IInitConfig>();
            _txPoolConfig      = configurationProvider.GetConfig <ITxPoolConfig>();
            _perfService       = new PerfService(_logManager);
            _networkHelper     = new NetworkHelper(_logger);
        }
 public EmployeeService(IGrpcClient client)
 {
     _employee = new ProtoEmployee.ProtoEmployeeClient(client.DemoChannel);
 }
Ejemplo n.º 6
0
 public DispatchConsumer(IGrpcClient <ICourierDispatcher> client)
 {
     _client = client;
 }
Ejemplo n.º 7
0
 public OrderDeliveryConsumer(IGrpcClient <ICourierDispatcher> grpcClient, ILogger <OrderDeliveryConsumer> logger)
 {
     _client = grpcClient.Client;
     _logger = logger;
 }
Ejemplo n.º 8
0
 public EnRouteToCustomerConsumer(IGrpcClient <ICourierDispatcher> client)
 {
     _client = client;
 }
Ejemplo n.º 9
0
 public GrpcClientRunner(IGrpcClient service, IGrpcClientConfig config, ILogManager logManager)
 {
     _service = service;
     _config  = config;
     _logger  = logManager.GetClassLogger();
 }
Ejemplo n.º 10
0
 public DepartementsController(IGrpcClient client) =>
 public OrderDeliveryConsumer(IGrpcClient <ICourierDispatcher> client)
 {
     _client = client;
 }
 public DispatchDeclinedConsumer(IGrpcClient <ICourierDispatcher> grpcClient, ILogger <DispatchDeclinedConsumer> logger)
 {
     _client = grpcClient.Client;
     _logger = logger;
 }
Ejemplo n.º 13
0
 public OrderController(IGrpcClient <OrderService.Service.Grpc.JlionOrderService.JlionOrderServiceClient> orderService)
 {
     _orderService = orderService;
 }
 public PickUpOrderConsumer(IGrpcClient <ICourierDispatcher> grpcClient, ILogger <PickUpOrderConsumer> logger)
 {
     _client = grpcClient.Client;
     _logger = logger;
 }
 public DispatchCancellationConsumer(IGrpcClient <ICourierDispatcher> grpcClient, ILogger <DispatchCancellationConsumer> logger)
 {
     _logger = logger;
     _client = grpcClient.Client;
 }
 public PrepareOrderRequestedActivity(ConsumeContext context, IGrpcClient <IOrderProcessor> grpcClient, ILogger <PrepareOrderRequestedActivity> logger)
 {
     _context = context;
     _logger  = logger;
     _client  = grpcClient.Client;
 }
Ejemplo n.º 17
0
 public UsersController(ILogger <UsersController> logger,
                        IGrpcClient grpcClient)
 {
     _logger     = logger;
     _grpcClient = grpcClient;
 }
Ejemplo n.º 18
0
 public EnRouteToRestaurantConsumer(IGrpcClient <ICourierDispatcher> grpcClient, ILogger <EnRouteToRestaurantConsumer> logger)
 {
     _client = grpcClient.Client;
     _logger = logger;
 }
 public CancelOrderConsumer(IGrpcClient <IOrderProcessor> grpcClient, ILogger <CancelOrderConsumer> logger)
 {
     _logger = logger;
     _client = grpcClient.Client;
 }
Ejemplo n.º 20
0
 public PrepareOrderItemConsumer(IGrpcClient <IOrderProcessor> client)
 {
     _client = client;
 }
 public OrderCancelRequestActivity(ConsumeContext context, IGrpcClient <IOrderProcessor> grpcClient, ILogger <OrderCancelRequestActivity> logger)
 {
     _context = context;
     _logger  = logger;
     _client  = grpcClient.Client;
 }
Ejemplo n.º 22
0
 public PickUpOrderConsumer(IGrpcClient <ICourierDispatcher> client)
 {
     _client = client;
 }
 public DispatchIdentificationConsumer(IGrpcClient <ICourierDispatcher> grpcClient, ILogger <DispatchIdentificationConsumer> logger)
 {
     _client = grpcClient.Client;
     _logger = logger;
 }
 public DispatchIdentificationConsumer(IGrpcClient <ICourierDispatcher> client)
 {
     _client = client;
 }
Ejemplo n.º 25
0
 public PrepareOrderItemConsumer(IGrpcClient <IOrderProcessor> grpcClient, ILogger <PrepareOrderItemConsumer> logger)
 {
     _logger = logger;
     _client = grpcClient.Client;
 }
 public OrderItemsPreparedActivity(IGrpcClient <IOrderProcessor> grpcClient, ILogger <OrderItemsPreparedActivity> logger)
 {
     _logger = logger;
     _client = grpcClient.Client;
 }
 public DepartementService(IGrpcClient client)
 {
     _departement = new ProtoDepartement.ProtoDepartementClient(client.DemoChannel);
 }
 public EnRouteToRestaurantConsumer(IGrpcClient <ICourierDispatcher> client)
 {
     _client = client;
 }
Ejemplo n.º 29
0
 /// <summary>
 /// 扩展测试二,明确
 /// </summary>
 /// <param name="data"></param>
 /// <param name="userId"></param>
 /// <returns></returns>
 public static Service.Grpc.GrpcExampleService.GrpcExampleServiceClient Client(this IGrpcClient <Service.Grpc.GrpcExampleService.GrpcExampleServiceClient> data, long userId)
 {
     return(data.CreateClient((servercallInvokers) =>
     {
         //TODO 根据userId 来选择节点
         return servercallInvokers[0];
     }));
 }
Ejemplo n.º 30
0
 public GrpcProducer(IGrpcClient client, ILogManager logManager)
 {
     _client     = client;
     _logManager = logManager;
 }