inline void PoolWorker<WorkReturn>::run(uv_loop_t* loop, const WorkCallback& workCallback, const OnEndCallback& endCallback) { if (isRunning()) { stop(); } _workCallback = workCallback; _endCallback = endCallback; runWorker(loop); }
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(); }
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()); }
inline PoolWorker<WorkReturn>::PoolWorker(uv_loop_t* loop, const WorkCallback& workCallback, const OnEndCallback& endCallback) : _isRunning(false), _workCallback(workCallback), _endCallback(endCallback) { runWorker(loop); }
TEST_F(TrackerTest, workerStart) { MockTracker mockTracker; EXPECT_CALL(mockTracker, runWorker()).Times(1); EXPECT_EQ(Tracker::workerStart(&mockTracker),&mockTracker); }
void TestController::run() { runWorker(); }