private static EnhancedServiceParams BuildBaseParams(string connectionString, int poolSize, PoolParams poolParams = null, ConnectionParams connectionParams = null, CachingParams cachingParams = null) { var parameters = new EnhancedServiceParams { ConnectionParams = connectionParams ?? new ConnectionParams { ConnectionString = connectionString }, PoolParams = poolParams ?? new PoolParams { PoolSize = poolSize } }; if (cachingParams != null) { parameters.IsCachingEnabled = true; parameters.CachingParams = cachingParams; } if (AutoSetMaxPerformanceParams) { parameters.AutoSetMaxPerformanceParams(); } return(parameters); }
public EnhancedServicePool(EnhancedServiceFactory <TServiceInterface, TEnhancedOrgService> factory, int poolSize) { this.factory = factory; poolParams = new PoolParams { PoolSize = poolSize }; }
public EmptyNodesPool(PoolParams poolParams) { this.poolParams = poolParams; for (int i = 0; i < poolParams.PreloadedInstances; i++) { Push(Create()); } }
public static void SetPerformanceParams(PoolParams parameters) { parameters.Require(nameof(parameters)); if (parameters.DotNetSetMinAppReservedThreads.HasValue) { var minThreads = parameters.DotNetSetMinAppReservedThreads.Value; ThreadPool.SetMinThreads(minThreads, minThreads); } }
public SingleTypePool(PoolParams poolParams) { this.poolParams = poolParams; emptyNodesPool = new EmptyNodesPool(poolParams); for (int i = 0; i < poolParams.PreloadedInstances; i++) { Push(Create()); } }
public EnhancedServicePool(EnhancedServiceFactory <TServiceInterface, TEnhancedOrgService> factory, PoolParams poolParams = null) { this.factory = factory; if (poolParams != null) { poolParams.IsLocked = true; } this.poolParams = poolParams ?? factory.Parameters?.PoolParams ?? new PoolParams(); }
public void OnConstruct() { // DebugUtils.Log("PoolStorageView.OnConstruct()"); for (int i = 0; i < poolsParams.Length; ++i) { PoolParams poolParams = poolsParams[i]; var instanceProvider = new ViewInstanceProvider( poolParams.ViewProto, instantiator, instanceContainer); var pool = new Pool <PoolableView>(instanceProvider, poolParams.InitialSize); poolsMap.Add(poolParams.ViewProto.PoolId, pool); } }
public static IEnhancedServicePool <ICachingOrgService> GetPoolCaching(ConnectionParams connectionParams, PoolParams poolParams, CachingParams cachingParams = null) { var parameters = BuildBaseParams(string.Empty, 2, null, connectionParams, cachingParams ?? new CachingParams()); var factory = new EnhancedServiceFactory <ICachingOrgService, CachingOrgService>(parameters); return(new EnhancedServicePool <ICachingOrgService, CachingOrgService>(factory, poolParams)); }
public DefaultServicePool(string connectionString, PoolParams poolParams = null) : this(new ConnectionParams { ConnectionString = connectionString }, poolParams) { }
public static IEnhancedServicePool <IEnhancedOrgService> GetPool(ConnectionParams connectionParams, PoolParams poolParams) { var parameters = BuildBaseParams(string.Empty, 2, poolParams, connectionParams); var factory = new EnhancedServiceFactory <IEnhancedOrgService, Services.Enhanced.EnhancedOrgService>(parameters); return(new EnhancedServicePool <IEnhancedOrgService, Services.Enhanced.EnhancedOrgService>(factory, poolParams)); }
public static IEnhancedServicePool <ICachingOrgService> GetCachingPool(string connectionString, PoolParams poolParams, CachingParams cachingParams = null) { connectionString.RequireFilled(nameof(connectionString)); poolParams.Require(nameof(poolParams)); return(GetCachingPool(BuildBaseParams(connectionString, null, poolParams, cachingParams: cachingParams ?? new CachingParams()))); }
public static IEnhancedServicePool <ICachingOrgService> GetCachingPool(ConnectionParams connectionParams, PoolParams poolParams, CachingParams cachingParams = null) { connectionParams.Require(nameof(connectionParams)); poolParams.Require(nameof(poolParams)); return(GetCachingPool(BuildBaseParams(null, null, poolParams, connectionParams, cachingParams ?? new CachingParams()))); }
public static IEnhancedServicePool <IEnhancedOrgService> GetPool(ConnectionParams connectionParams, PoolParams poolParams) { connectionParams.Require(nameof(connectionParams)); poolParams.Require(nameof(poolParams)); return(GetPool(BuildBaseParams(null, null, poolParams, connectionParams))); }
public static IEnhancedServicePool <IEnhancedOrgService> GetPool(string connectionString, PoolParams poolParams) { connectionString.RequireFilled(nameof(connectionString)); poolParams.Require(nameof(poolParams)); return(GetPool(BuildBaseParams(connectionString, null, poolParams))); }
/// <summary> /// Instantiates the <see cref="FakeNativeMemoryChunkPool"/>. /// </summary> public FakeNativeMemoryChunkPool(PoolParams poolParams) : base( new MockMemoryTrimmableRegistry(), poolParams, new MockPoolStatsTracker()) { }
public DefaultServicePool(ConnectionParams connectionParams, PoolParams poolParams = null) : base(new ServiceFactory(connectionParams, poolParams?.TokenExpiryCheck), poolParams) { }
public DefaultServicePool(IServiceFactory <IOrganizationService> factory, PoolParams poolParams = null) : base(factory, poolParams) { }