public WebSocketGremlinQueryExecutor( GremlinServer gremlinServer, IGremlinClientFactory clientFactory, string alias = "g") { _alias = alias; _aliasArgs = new Dictionary <string, string> { { "g", _alias } }; _lazyGremlinClient = new SmarterLazy <IGremlinClient>( async logger => { try { return(await Task.Run(() => clientFactory.Create( gremlinServer, JsonNetMessageSerializer.GraphSON3, new ConnectionPoolSettings(), _ => { }))); } catch (Exception ex) { logger.LogError(ex, $"Failure creating an instance of {nameof(IGremlinClient)}."); throw; } }); }
public WebSocketConfigurator( GremlinServer gremlinServer, IGremlinClientFactory clientFactory, string alias) { _alias = alias; _gremlinServer = gremlinServer; _clientFactory = clientFactory; }
public GraphRepository(IGremlinClientFactory clientFactory, IPathResultsTransform pathResultsTransform, int degreeOfParallelism = 5) { Guard.ArgumentNotNull(pathResultsTransform, nameof(pathResultsTransform)); Guard.ArgumentNotNull(clientFactory, nameof(clientFactory)); _pathResultsTransform = pathResultsTransform; _clientFactory = clientFactory; _degreeOfParallelism = degreeOfParallelism; }
public CommodityDataAdapter(IGremlinClientFactory clientFactory) : base(clientFactory) { }
public void RegisterComponents(IServiceCollection builder) { builder.AddSingleton <IUserProfileProvider, UserProfileProvider>(); builder .AddScoped <IHealthChecker, ControllerResolverHealthCheck>(); builder .AddScoped <IGremlinClientFactory, GremlinClientFactory>(); builder .AddScoped <IPathResultsTransform, PathResultsTransform>(); builder .AddScoped <ICosmosGraphDbSettings>(ctx => { CosmosGraphDbSettings settings = new CosmosGraphDbSettings(); Configuration.Bind("CosmosGraphSettings", settings); return(settings); }); builder .AddScoped <IGraphRepository>(ctx => { IGremlinClientFactory gremlinClientFactory = ctx.GetService <IGremlinClientFactory>(); IPathResultsTransform pathResultsTransform = ctx.GetService <IPathResultsTransform>(); ICosmosGraphDbSettings settings = ctx.GetService <ICosmosGraphDbSettings>(); return(new GraphRepository(gremlinClientFactory, pathResultsTransform, settings.DegreeOfParallelism == 0 ? 15 : settings.DegreeOfParallelism)); }); builder .AddScoped <ISpecificationRepository, SpecificationRepository>(); builder .AddScoped <ICalculationRepository, CalculationRepository>(); builder .AddScoped <IGraphService, GraphService>(); builder .AddScoped <IDatasetRepository, DatasetRepository>(); builder .AddScoped <IFundingLineRepository, FundingLineRepository>(); builder.AddApiKeyMiddlewareSettings((IConfigurationRoot)Configuration); builder.AddHttpContextAccessor(); builder.AddHealthCheckMiddleware(); builder.AddApplicationInsightsTelemetry(); builder.AddApplicationInsightsTelemetryClient(Configuration, "CalculateFunding.Api.Graph"); builder.AddApplicationInsightsServiceName(Configuration, "CalculateFunding.Api.Graph"); builder.AddLogging("CalculateFunding.Api.Graph"); if (Configuration.IsSwaggerEnabled()) { builder.ConfigureSwaggerServices(title: "Graph Microservice API"); } }
public GremlinDataAdapter(IGremlinClientFactory clientFactory) { ClientFactory = clientFactory; }
public ConnectionPoolSettingsGremlinClientFactory(IGremlinClientFactory factory, IConfigurationSection section) { _factory = factory; _section = section; }