keystroke
This will send a typing.started
event to the server. Events are throttled according to the heartbeatThrottleMs
room option. If an event has been sent within the interval, this operation is no-op.
Calls to keystroke()
and stop()
are serialized and will always be performed in the correct order.
For example, if multiple
keystroke()
calls are made in quick succession before the firstkeystroke()
call has sent atyping.started
event to the server, followed by onestop()
call, thestop()
call will execute as soon as the firstkeystroke()
call completes. All intermediatekeystroke()
calls will be treated as no-ops.The most recent operation (
keystroke()
orstop()
) will always determine the final state, ensuring operations resolve to a consistent and correct state.
Throws
if there is a problem acquiring the mutex that controls serialization.