You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
/// - Parameter subscription: A ``OnLiveObjectLifecycleEventResponse`` object that allows the provided listener to deregister itself from future updates.
/// Registers the provided listener for the specified event. If `on()` is called more than once with the same listener and event, the listener is added multiple times to its listener registry. Therefore, as an example, assuming the same listener is registered twice using `on()`, and an event is emitted once, the listener would be invoked twice.
72
55
///
73
56
/// - Parameters:
@@ -250,66 +233,6 @@ public protocol OnObjectsEventResponse: Sendable {
250
233
func off()
251
234
}
252
235
253
-
/// Enables grouping multiple Objects operations together by providing `BatchContext*` wrapper objects.
254
-
publicprotocolBatchContext:Sendable{
255
-
/// Mirrors the ``RealtimeObjects/getRoot()`` method and returns a ``BatchContextLiveMap`` wrapper for the root object on a channel.
256
-
///
257
-
/// - Returns: A ``BatchContextLiveMap`` object.
258
-
func getRoot()->BatchContextLiveMap
259
-
}
260
-
261
-
/// A wrapper around the ``LiveMap`` object that enables batching operations inside a ``BatchCallback``.
/// Mirrors the ``LiveMap/get(key:)`` method and returns the value associated with a key in the map.
264
-
///
265
-
/// - Parameter key: The key to retrieve the value for.
266
-
/// - Returns: A ``LiveObject``, a primitive type (string, number, boolean, JSON-serializable object or array ,or binary data) or `nil` if the key doesn't exist in a map or the associated ``LiveObject`` has been deleted. Always `nil` if this map object is deleted.
267
-
func get(key:String)->LiveMapValue?
268
-
269
-
/// Returns the number of key-value pairs in the map.
270
-
varsize:Int{get}
271
-
272
-
/// Similar to the ``LiveMap/set(key:value:)`` method, but instead, it adds an operation to set a key in the map with the provided value to the current batch, to be sent in a single message to the Ably service.
273
-
///
274
-
/// This does not modify the underlying data of this object. Instead, the change is applied when
275
-
/// the published operation is echoed back to the client and applied to the object.
276
-
/// To get notified when object gets updated, use the ``LiveObject/subscribe(listener:)`` method.
277
-
///
278
-
/// - Parameters:
279
-
/// - key: The key to set the value for.
280
-
/// - value: The value to assign to the key.
281
-
func set(key:String, value:LiveMapValue?)
282
-
283
-
/// Similar to the ``LiveMap/remove(key:)`` method, but instead, it adds an operation to remove a key from the map to the current batch, to be sent in a single message to the Ably service.
284
-
///
285
-
/// This does not modify the underlying data of this object. Instead, the change is applied when
286
-
/// the published operation is echoed back to the client and applied to the object.
287
-
/// To get notified when object gets updated, use the ``LiveObject/subscribe(listener:)`` method.
288
-
///
289
-
/// - Parameter key: The key to set the value for.
290
-
func remove(key:String)
291
-
}
292
-
293
-
/// A wrapper around the ``LiveCounter`` object that enables batching operations inside a ``BatchCallback``.
/// Similar to the ``LiveCounter/increment(amount:)`` method, but instead, it adds an operation to increment the counter value to the current batch, to be sent in a single message to the Ably service.
299
-
///
300
-
/// This does not modify the underlying data of this object. Instead, the change is applied when
301
-
/// the published operation is echoed back to the client and applied to the object.
302
-
/// To get notified when object gets updated, use the ``LiveObject/subscribe(listener:)`` method.
303
-
///
304
-
/// - Parameter amount: The amount by which to increase the counter value.
305
-
func increment(amount:Double)
306
-
307
-
/// An alias for calling [`increment(-amount)`](doc:BatchContextLiveCounter/increment(amount:)).
308
-
///
309
-
/// - Parameter amount: The amount by which to decrease the counter value.
310
-
func decrement(amount:Double)
311
-
}
312
-
313
236
/// The `LiveMap` class represents a key-value map data structure, similar to a Swift `Dictionary`, where all changes are synchronized across clients in realtime.
314
237
/// Conflicts in a LiveMap are automatically resolved with last-write-wins (LWW) semantics,
315
238
/// meaning that if two clients update the same key in the map, the update with the most recent timestamp wins.
0 commit comments