Пример #1
0
 inline void PoolWorker<WorkReturn>::run(uv_loop_t* loop, const WorkCallback& workCallback, const OnEndCallback& endCallback) {
     if (isRunning()) {
         stop();
     }
     _workCallback = workCallback;
     _endCallback = endCallback;
     runWorker(loop);
 }
Пример #2
0
void TestControllerParallel::run() {
	barrier();
	if (attr->is_worker())
		runWorker();

#ifdef HAVE_MPI
	if (attr->is_server())
		runServer();
#endif
	barrier();
//	std::cerr << "incrementing program number after run" << std::endl << std::flush;
	sip::JobControl::global->increment_program();
	barrier();
}
Пример #3
0
  TEST_F(TrackerTest, runWorker)
  {
    MockTracker mockTracker;
    EXPECT_CALL(mockTracker, runWorker())
      .WillOnce(Invoke(&mockTracker, &MockTracker::TrackerRunWorker));

    mockTracker._newClient.push(new Client(NULL));
    mockTracker._newClient.push(new Client(NULL));
    mockTracker._newClient.push(new Client(NULL));

    EXPECT_CALL(mockTracker, treat(_)).Times(3);
    
    EXPECT_CALL(mockTracker, reply(_))
      .WillOnce(Return())
      .WillOnce(Return())
      .WillOnce(Invoke(this,&TrackerTest::exitRunning2));

    mockTracker._run = true;
    mockTracker.runWorker();

    EXPECT_TRUE(mockTracker._newClient.empty());
  }
Пример #4
0
 inline PoolWorker<WorkReturn>::PoolWorker(uv_loop_t* loop, const WorkCallback& workCallback, const OnEndCallback& endCallback)
 : _isRunning(false), _workCallback(workCallback), _endCallback(endCallback) {
     runWorker(loop);
 }
Пример #5
0
 TEST_F(TrackerTest, workerStart)
 {
   MockTracker mockTracker;
   EXPECT_CALL(mockTracker, runWorker()).Times(1);
   EXPECT_EQ(Tracker::workerStart(&mockTracker),&mockTracker);
 }
Пример #6
0
void TestController::run() {
	runWorker();
}