本文整理汇总了C++中Future::tasks方法的典型用法代码示例。如果您正苦于以下问题:C++ Future::tasks方法的具体用法?C++ Future::tasks怎么用?C++ Future::tasks使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Future
的用法示例。
在下文中一共展示了Future::tasks方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: foreach
FUTURE_PROTOBUF(SlaveReregisteredMessage(), _, _);
Future<ReregisterSlaveMessage> reregisterSlaveMessage =
FUTURE_PROTOBUF(ReregisterSlaveMessage(), _, _);
// Simulate a spurious master change event (e.g., due to ZooKeeper
// expiration) at the slave to force re-registration.
detector.appoint(master.get()->pid);
// Expect to receive the 'ReregisterSlaveMessage' containing the
// active frameworks.
AWAIT_READY(reregisterSlaveMessage);
// Both tasks should be present; the command executor task shouldn't have an
// executor ID, but the default executor task should have one.
EXPECT_EQ(2, reregisterSlaveMessage->tasks().size());
foreach (const Task& task, reregisterSlaveMessage->tasks()) {
if (task.task_id() == commandExecutorTask.task_id()) {
EXPECT_FALSE(task.has_executor_id())
<< "The command executor ID is present, but it"
<< " shouldn't be sent to the master";
} else {
EXPECT_TRUE(task.has_executor_id())
<< "The default executor ID is missing";
}
}
AWAIT_READY(slaveReregisteredMessage);
// Check the response of the master state endpoint.
Future<process::http::Response> response = process::http::get(