Represents a co-doing session.
Constant Summary
int | MAX_CODOING_BLOB_BYTES | Maximum allowed blob size in bytes. |
int | PREFERRED_MAX_CODOING_BLOB_BYTES | Preferred maximum allowed blob size (1kb) in bytes. |
Public Method Summary
abstract void |
Constants
public static final int MAX_CODOING_BLOB_BYTES
Maximum allowed blob size in bytes.
public static final int PREFERRED_MAX_CODOING_BLOB_BYTES
Preferred maximum allowed blob size (1kb) in bytes.
Public Methods
public abstract void setGlobalState (CoDoingState newGlobalState)
Updates the shared global state. This state is broadcast to all other participants and becomes the default state for all participants, existing or new, until a new state is set.
Note: This shared state is eventually consistent across participants. For predictable behavior, this binary state should be complete state, not partial, as the Live Sharing SDK does not provide guarantees around the delivery of individual messages -- only eventual consistency.
Note: In a race condition where two participants call this method simultaneously, the Live Sharing SDK will select a canonical winning update. The losing update may or may not be applied to participants, but the winning update will always be applied later.
Parameters
newGlobalState | the updated activity state that will be broadcast to other participants.
Preferred maximum blob size is
PREFERRED_MAX_CODOING_BLOB_BYTES . |
---|
Throws
NullPointerException | if newGlobalState is null |
---|---|
LiveSharingException | if there was an unexpected error |
IllegalStateException | if called after the co-doing session has ended |
IllegalStateException | if blob size >
MAX_CODOING_BLOB_BYTES |