コード例 #1
0
ファイル: libev.hpp プロジェクト: 447327642/mesos
void _run_in_event_loop(
    const lambda::function<Future<T>()>& f,
    const Owned<Promise<T>>& promise)
{
  // Don't bother running the function if the future has been discarded.
  if (promise->future().hasDiscard()) {
    promise->discard();
  } else {
    promise->set(f());
  }
}
コード例 #2
0
ファイル: registrar.cpp プロジェクト: evanv/mesos
Future<bool> RegistrarProcess::_apply(Owned<Operation> operation)
{
  CHECK_SOME(variable);

  operations.push_back(operation);
  Future<bool> future = operation->future();
  if (!updating) {
    update();
  }
  return future;
}
コード例 #3
0
ファイル: registrar.cpp プロジェクト: Adyoulike/mesos
Future<bool> RegistrarProcess::_apply(Owned<Operation> operation)
{
  if (error.isSome()) {
    return Failure(error.get());
  }

  CHECK_SOME(variable);

  operations.push_back(operation);
  Future<bool> future = operation->future();
  if (!updating) {
    update();
  }
  return future;
}