Awareness
elva.awareness
Module with the awareness component definition.
Classes:
Attributes:
-
AwarenessState
–The states of the
Awareness
component.
AwarenessState = create_component_state('AwarenessState')
module-attribute
The states of the Awareness
component.
Awareness
Component version of pycrdt
's Awareness
class.
Methods:
-
run
–Hook performing periodic awareness updates.
-
cleanup
–Hook removing the local awareness state.
-
observe
–Add a callback to be run on awareness state changes.
-
unobserve
–Remove a registered callback.
Attributes:
-
client_states
(dict
) –The client states.
-
states
(AwarenessState
) –The states this component can have.
client_states
property
The client states.
states
property
The states this component can have.
run()
async
cleanup()
async
observe(callback)
Add a callback to be run on awareness state changes.
Parameters:
-
callback
(Callable[[str, tuple[dict[str, Any], Any]], None]
) –the function to call on state changes.
Returns:
Source code in src/elva/awareness.py
unobserve(observer_id)
Remove a registered callback.
Parameters: