{
  "repo": "tidbcloud/dataservices",
  "binary": "central_worker",
  "binary_path": "cmd/central_worker/main.go",
  "surface_kind": "mixed_service",
  "type": "mixed_service",
  "extensions": {
    "notes": [
      "This binary is a long-running worker process, not an HTTP business service.",
      "Shutdown behavior is signal-driven and part of the runtime surface because workerManager.Process() runs until SIGINT or SIGTERM arrives."
    ]
  },
  "services": [
    {
      "name": "CentralWorkerLifecycle",
      "package": "cmd/central_worker",
      "methods": [
        {
          "name": "LoadConfigAndDatabase",
          "name_key": "CentralWorkerLifecycle.LoadConfigAndDatabase",
          "input": "config-path and MySQL connection settings",
          "output": "global config initialized and MySQL connection created",
          "type": "local"
        },
        {
          "name": "StartEventbus",
          "name_key": "CentralWorkerLifecycle.StartEventbus",
          "input": "MySQL connection",
          "output": "dataservice_worker eventbus running when not in local mode",
          "type": "background_worker"
        },
        {
          "name": "InitBackends",
          "name_key": "CentralWorkerLifecycle.InitBackends",
          "input": "DynamoDB config and Redis config",
          "output": "DynamoDB and Redis clients initialized",
          "type": "local"
        },
        {
          "name": "StartTracing",
          "name_key": "CentralWorkerLifecycle.StartTracing",
          "input": "component name dataservice-central",
          "output": "Jaeger tracer provider initialized",
          "type": "local"
        },
        {
          "name": "StartMetricsServer",
          "name_key": "CentralWorkerLifecycle.StartMetricsServer",
          "input": "metrics port from config",
          "output": "HTTP metrics listener exposing /metrics",
          "type": "background_worker"
        },
        {
          "name": "StartWorkerManager",
          "name_key": "CentralWorkerLifecycle.StartWorkerManager",
          "input": "deployment, common-task, etl, and privatelink workers",
          "output": "worker manager processing jobs until SIGINT or SIGTERM",
          "type": "background_worker"
        },
        {
          "name": "ShutdownWorkerManager",
          "name_key": "CentralWorkerLifecycle.ShutdownWorkerManager",
          "input": "SIGINT or SIGTERM and 5-second shutdown timeout",
          "output": "worker manager shutdown completed",
          "type": "local"
        }
      ]
    },
    {
      "name": "CentralWorkerHTTP",
      "package": "cmd/central_worker",
      "type": "http",
      "methods": [
        {
          "name": "GET /metrics",
          "name_key": "HTTP GET /metrics",
          "path": "/metrics",
          "http_method": "GET",
          "input": "none",
          "output": "Prometheus metrics",
          "type": "http"
        }
      ]
    }
  ]
}
