/// <summary> /// /// </summary> /// <param name="factory"></param> /// <param name="config"></param> public DefaultServiceMapper(RpcServiceFactory factory, RpcConfig config) { if (factory == null) throw new ArgumentNullException(nameof(factory)); if (config == null) throw new ArgumentNullException(nameof(config)); _config = config; _factory = factory; }
/// <summary> /// /// </summary> /// <param name="factory"></param> /// <param name="config"></param> public DefaultServiceMapper(RpcServiceFactory factory, RpcConfig config) { if (factory == null) { throw new ArgumentNullException(nameof(factory)); } if (config == null) { throw new ArgumentNullException(nameof(config)); } _config = config; _factory = factory; }
/// <summary> /// /// </summary> public ServiceHost(AppHost appHost, RpcConfig config) { _config = config; _appHost = appHost; _serviceFactory = new RpcServiceFactory(_appHost, config); _initializeRegistry = new Lazy<object>(() => { var services = _config?.Service?.Services; if (services == null || _appHost.Registry?.CanRegister != true) return null; foreach (var service in services) { _appHost.Registry.RegisterAsync(service.ToServiceInfo()); } return null; }); }
/// <summary> /// /// </summary> public ServiceHost(AppHost appHost, RpcConfig config) { _config = config; _appHost = appHost; _serviceFactory = new RpcServiceFactory(_appHost, config); _initializeRegistry = new Lazy <object>(() => { var services = _config?.Service?.Services; if (services == null || _appHost.Registry?.CanRegister != true) { return(null); } foreach (var service in services) { _appHost.Registry.RegisterAsync(service.ToServiceInfo()); } return(null); }); }
/// <summary> /// /// </summary> /// <param name="factory"></param> /// <param name="config"></param> /// <returns></returns> public IServiceMapper CreateServiceMapper(RpcServiceFactory factory, RpcConfig config) { return(new DefaultServiceMapper(factory, config)); }
/// <summary> /// /// </summary> /// <param name="factory"></param> /// <param name="config"></param> /// <returns></returns> public IServiceMapper CreateServiceMapper(RpcServiceFactory factory, RpcConfig config) { return new DefaultServiceMapper(factory, config); }