MCPcopy Create free account
hub / github.com/apache/mesos / launch

Method launch

src/examples/long_lived_executor.cpp:203–218  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

201 }
202
203 void launch(const TaskInfo& task)
204 {
205 cout << "Starting task " << task.task_id().value() << endl;
206
207 tasks[task.task_id()] = task;
208
209 std::thread thread([=]() {
210 os::sleep(Seconds(random() % 10));
211
212 process::dispatch(self(), &Self::update, task, TaskState::TASK_FINISHED);
213 });
214
215 thread.detach();
216
217 update(task, TaskState::TASK_RUNNING);
218 }
219
220private:
221 const FrameworkID frameworkId;

Callers 2

receivedMethod · 0.45
receivedMethod · 0.45

Calls 7

SecondsClass · 0.85
randomFunction · 0.85
sleepFunction · 0.50
dispatchFunction · 0.50
updateFunction · 0.50
valueMethod · 0.45
detachMethod · 0.45

Tested by 1

receivedMethod · 0.36