Skip to content

Commit 7be070b

Browse files
author
Shubham
committed
Add requestUpdates() and cancelUpdates() methods
1 parent 04d5a36 commit 7be070b

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

objectbox/c.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1259,3 +1259,9 @@ class Feature(IntEnum):
12591259

12601260

12611261
obx_has_feature = c_fn('obx_has_feature', ctypes.c_bool, [OBXFeature])
1262+
1263+
# OBX_C_API obx_err obx_sync_updates_request(OBX_sync* sync, bool subscribe_for_pushes);
1264+
obx_sync_updates_request = c_fn_rc('obx_sync_updates_request', [OBX_sync_p, ctypes.c_bool])
1265+
1266+
# OBX_C_API obx_err obx_sync_updates_cancel(OBX_sync* sync);
1267+
obx_sync_updates_cancel = c_fn_rc('obx_sync_updates_cancel', [OBX_sync_p])

objectbox/sync.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,12 @@ def stop(self):
245245
def trigger_reconnect(self) -> bool:
246246
return c.check_obx_success(c.obx_sync_trigger_reconnect(self.__c_sync_client_ptr))
247247

248+
def request_updates(self, subscribe_for_future_pushes: bool) -> bool:
249+
return c.check_obx_success(c.obx_sync_updates_request(self.__c_sync_client_ptr, subscribe_for_future_pushes))
250+
251+
def cancel_updates(self) -> bool:
252+
return c.check_obx_success(c.obx_sync_updates_cancel(self.__c_sync_client_ptr))
253+
248254
@staticmethod
249255
def protocol_version() -> int:
250256
return c.obx_sync_protocol_version()

0 commit comments

Comments
 (0)