public void setup() { _dispatcher = Substitute.For<IDispatch<object>>(); _queue = new InMemoryWorkQueue<object>(); _subject = new DirectWorkerPool<object>(); _subject.SetSource(_dispatcher, _queue); }
public SpecificThreadParticipant(IParticipantReference <TRequest, TResponse> func, int threadId, IWorkerPool workerPool, string name) { _func = func; _threadId = threadId; _workerPool = workerPool; _name = name; }
public void Initialize() { _xulDeployer.Deploy(_configurationHandler.XulLocation); _workers = _poolProvider.Create(_configurationHandler.MinimumWorkerCount, _configurationHandler.MaximumWorkerCount); _initialized = true; }
public Actions(IWorkerPool workers, IKanbanBoard board, IStore store, IState state) { _workers = workers; _board = board; _store = store; _state = state; }
public ParticipantBuilder(IScatterGatherBus messageBus, IWorkerPool workerPool) { Assert.ArgumentNotNull(messageBus, nameof(messageBus)); Assert.ArgumentNotNull(workerPool, nameof(workerPool)); _workerPool = workerPool; _dispatchType = DispatchThreadType.NoPreference; }
public ListenerBuilder(IReqResBus messageBus, IWorkerPool workerPool) { Assert.ArgumentNotNull(messageBus, nameof(messageBus)); Assert.ArgumentNotNull(workerPool, nameof(workerPool)); _messageBus = messageBus; _workerPool = workerPool; }
public ThreadPoolThreadSubscription(IWorkerPool workerPool, ISubscriberReference <TPayload> action) { Assert.ArgumentNotNull(workerPool, nameof(workerPool)); Assert.ArgumentNotNull(action, nameof(action)); _workerPool = workerPool; _action = action; }
public static void Initialize(TestContext testContext) { IWorkerFactory <IWorker> workerFactory = new LocalWorkerFactory(); _testedPool = FreezerGlobal.Workers; _httpServer = new StaticHttpServer(FreezerTestPathSolver.GetDirectory("WebPages")); }
public SpecificThreadPubSubSubscription(ISubscriberReference <TPayload> action, int threadId, IWorkerPool workerPool) { Assert.ArgumentNotNull(action, nameof(action)); Assert.ArgumentNotNull(workerPool, nameof(workerPool)); _action = action; _threadId = threadId; _workerPool = workerPool; }
public void setup() { _actionCalled = false; _dispatcher = Substitute.For<IDispatch<object>>(); _dispatcher.MaximumInflight().Returns(1); _queue = Substitute.For<IWorkQueue<object>>(); _subject = new ThreadedWorkerPool<object>("name", 1); _subject.SetSource(_dispatcher, _queue); }
public ThreadPoolParticipant(IWorkerPool workerPool, IParticipantReference <TRequest, TResponse> action, string name) { Assert.ArgumentNotNull(workerPool, nameof(workerPool)); Assert.ArgumentNotNull(action, nameof(action)); _workerPool = workerPool; _action = action; _name = name; }
public SubscriptionBuilder(IPubSubBus messageBus, IWorkerPool workerPool) { Assert.ArgumentNotNull(messageBus, nameof(messageBus)); Assert.ArgumentNotNull(workerPool, nameof(workerPool)); _dispatchType = DispatchThreadType.NoPreference; _workerPool = workerPool; MessageBus = messageBus; Topics = null; }
private static ISampleWorkFactory GetWorkFactory(bool dummy, IWorkerPool workerPool, WorkAvailableRepo workAvailableRepo) { if (!dummy) { return(new ReadFromBlobSampleWorkFactory( () => workerPool.IsAlive, workAvailableRepo)); } return(new DummyWorkFactory(workAvailableRepo)); }
public OutboxMonitor(ILogger logger, IWorkerPool workers, int pollDelayMs) { Assert.ArgumentNotNull(logger, nameof(logger)); Assert.ArgumentNotNull(workers, nameof(workers)); Assert.IsInRange(pollDelayMs, nameof(pollDelayMs), 1000, int.MaxValue); _outboxes = new ConcurrentDictionary <long, IOutboxSender>(); var strategy = new OutboxWorkerStrategy(this, pollDelayMs); _thread = new IntervalWorkerThread(logger, strategy); _threadToken = workers.RegisterManagedThread("Outbox Module", _thread.ThreadId, "Outbox worker thread"); }
public DisposableWorkerPool(IWorkerPool inner, DisposableCollection tokens) { _inner = inner; _tokens = tokens; }
public void setup() { _queue = Substitute.For<IWorkQueue<object>>(); _pool = Substitute.For<IWorkerPool<object>>(); _pool.PoolSize().Returns(10000); _subject = new Dispatch<object>(_queue, _pool); }
public ReadOnlyWorkerPool(IWorkerPool workerPool) { _workerPool = workerPool; }
public WorkerToken(IWorkerPool workerPool, int threadId) { _workerPool = workerPool; ThreadId = threadId; IsSuccess = threadId > 0; }
public static IEventLoop CreateEventLoopForTheCurrentThread(IWorkerPool workerPool) { var context = workerPool.GetCurrentThreadContext(); return(new EventLoop(context, Thread.CurrentThread.ManagedThreadId)); }
public WorkerEngine(Size browserSize, Trigger trigger, CaptureZone captureZone, IWorkerPool <IWorker> workerPool) : base(browserSize, trigger, captureZone) { _workerPool = workerPool; }
/// <summary> /// Initializes a new instance of the <see cref="SynchronousConsumerEngine{TItem}"/> class. /// </summary> /// <param name="pool">The pool of workers available to consume the objects.</param> /// <param name="runner">The consumer runner which will consume the objects produced.</param> public SynchronousConsumerEngine(IWorkerPool pool, IConsumerExecutionStrategy <TItem> runner) { this.pool = pool ?? throw new ArgumentNullException(nameof(pool)); this.runner = runner ?? throw new ArgumentNullException(nameof(runner)); }
public State(IWorkerPool workers, IKanbanBoard board, IStore store) { _workers = workers; _board = board; _store = store; }
public AnyThreadParticipant(IParticipantReference <TRequest, TResponse> func, IWorkerPool workerPool, string name) { _func = func; _workerPool = workerPool; _name = name; }
public WorkPoolBuilder() { _workerPool = new WorkerPool(); _workQueue = new BlockingCollection <IWorkItem>(); }
public Worker(IWorkerPool pool, TcpChannel channel) { _pool = pool; _channel = channel; }
public AnyThreadListener(IListenerReference <TRequest, TResponse> func, IWorkerPool workerPool) { _func = func; _workerPool = workerPool; }
public WorkerPoolBuilder(IStartupBarrier startupBarrier = null) { _barrier = startupBarrier; _workerPool = new WorkerPool(); _workQueue = new BlockingCollection <IWorkItem>(); }
public SubscriptionWithDedicatedWorkerToken(IWorkerPool workerPool, IDisposable subscriptionToken, int threadId) { _workerToken = new WorkerToken(workerPool, threadId); _subscriptionToken = subscriptionToken; }
internal WorkerPoolBuilder(IWorkerPool workerPool, BlockingCollection <IWorkItem> workQueue) { _workerPool = workerPool; _workQueue = workQueue; }
public static void Initialize(TestContext testContext) { IWorkerFactory <IWorker> workerFactory = new LocalWorkerFactory(); _testedPool = FreezerGlobal.Workers; }
public SpecificThreadListener(IListenerReference <TRequest, TResponse> func, int threadId, IWorkerPool workerPool) { _func = func; _threadId = threadId; _workerPool = workerPool; }