---
agentTools:
  projectIndex: https://operations.readme.io/llms.txt
---

# Reachable Operation

`ReachableCondition` will ensure that a provided host is reachable before executing an operation. This is great, but in some cases there is not a known host, for example, when using `CloudKitOperation` where the device must be online. In these situations, we can compose an operation inside a `ReachableOperation`.

[block:code]
{
  "codes": [
    {
      "code": "let operation = ReachableOperation(aCriticalNetworkingOperation)\nqueue.addOperation(operation)",
      "language": "swift",
      "name": "reachable operation"
    }
  ]
}
[/block]

The `ReachableOperation` will register itself with an internal `Reachability` service, so that only when the status is available will the composed operation be executed.