| 1 | // Package replication plans and executes durable relay synchronization. |
| 2 | // |
| 3 | // Planning is separate from transport. RelayDirectory and Discovery provide |
| 4 | // routing inputs; PrepareIntents turns them into idempotent storage.Intent |
| 5 | // values that can be committed with the event that caused them. Delivery, |
| 6 | // PullTransport and PushTransport perform network operations and are owned by |
| 7 | // the application that constructs the Service or calls the standalone sync |
| 8 | // functions. Those callers retain ownership of their transports and stores. |
| 9 | // |
| 10 | // Service owns replication's durable work queue and job state. Handlers can be |
| 11 | // composed with other work handlers and run by work.RunPool. A handler error |
| 12 | // is retried by the work package with backoff; a terminal error can be marked |
| 13 | // with work.Stop. Successful recurring jobs enqueue a new intent, preserving a |
| 14 | // completed record for the prior run. |
| 15 | // |
| 16 | // WebSocket transports validate relay URLs and public address resolution before |
| 17 | // dialing. Backup and artifact helpers write complete files through temporary |
| 18 | // files and same-directory rename. |
| 19 | package replication |