Files
moloapp/src/google/registry/operation_runner.h
T
retoorandClaude Sonnet 5.5 cb70bb1116 feat(clients): registry: Agent Registry, Agent Gateway, Agent Identity from discovery call table
86-row call table checked against Google discovery documents, typed
services, local approval ledger, live read-only tests, /agent/registry demo.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-24 04:42:00 +02:00

26 lines
869 B
C++

#pragma once
// Shared by the registry, gateway and policy services: finish a mutation's
// long-running operation, and the read-before-mutate existence probe.
#include <functional>
#include <string>
#include "google/operation.h"
namespace molo::google::registry {
class OperationRunner {
public:
// Takes the reply of a create/patch/delete call. Returns {"operation":name}
// once done; polls through wait_operation (capped) when not yet done.
static clients::body::Json finish(GoogleClient& client, const ServiceEndpoint& endpoint,
const clients::body::Json& reply,
const Sleeper& sleeper);
// True when `probe` returns, false on HTTP 404, rethrows anything else.
static bool exists(const std::function<clients::body::Json()>& probe);
};
} // namespace molo::google::registry