2121#include < memory>
2222#include < string>
2323
24- #include < vix/net/NetworkProbe.hpp>
2524#include < vix/sync/Operation.hpp>
2625#include < vix/sync/outbox/Outbox.hpp>
2726
@@ -84,7 +83,7 @@ namespace vix::sync::engine
8483 * @brief Single-worker unit that processes ready operations from the Outbox.
8584 *
8685 * SyncWorker:
87- * - Consults NetworkProbe to decide if sending should proceed
86+ * - Consults configured send permission before delivery attempts
8887 * - Pulls a batch of ready operations from the Outbox
8988 * - Sends operations through ISyncTransport
9089 * - Applies retry/backoff decisions by updating Outbox state (implementation-defined)
@@ -117,7 +116,7 @@ namespace vix::sync::engine
117116 std::int64_t idle_sleep_ms{250 };
118117
119118 /* *
120- * @brief Sleep duration when network is considered offline .
119+ * @brief Sleep duration when delivery permission is denied .
121120 *
122121 * This is mainly used by higher-level orchestrators (SyncEngine).
123122 */
@@ -137,13 +136,13 @@ namespace vix::sync::engine
137136 *
138137 * @param cfg Worker configuration.
139138 * @param outbox Shared outbox used to fetch and update operations.
140- * @param probe Network probe used to detect offline/online state .
139+ * @param send_permission Optional policy deciding whether sending proceeds .
141140 * @param transport Transport used to deliver operations.
142141 */
143142 SyncWorker (
144143 Config cfg,
145144 std::shared_ptr<vix::sync::outbox::Outbox> outbox,
146- std::shared_ptr<vix::net::NetworkProbe> probe ,
145+ std::function< bool (std:: int64_t )> send_permission ,
147146 std::shared_ptr<ISyncTransport> transport);
148147
149148 /* *
@@ -161,7 +160,7 @@ namespace vix::sync::engine
161160 /* *
162161 * @brief Decide whether the worker should attempt sending right now.
163162 *
164- * Typically checks connectivity (NetworkProbe) and possibly Outbox state .
163+ * Applies the configured delivery permission policy .
165164 *
166165 * @param now_ms Current monotonic time in milliseconds.
167166 * @return true if sending should proceed, false otherwise.
@@ -191,9 +190,9 @@ namespace vix::sync::engine
191190 std::shared_ptr<vix::sync::outbox::Outbox> outbox_;
192191
193192 /* *
194- * @brief Network probe used to detect connectivity .
193+ * @brief Optional policy deciding whether sending proceeds at a given time .
195194 */
196- std::shared_ptr<vix::net::NetworkProbe> probe_ ;
195+ std::function< bool (std:: int64_t )> send_permission_ ;
197196
198197 /* *
199198 * @brief Transport used to send operations.
0 commit comments