acquireLock method

Future<SignalLock> acquireLock(
  1. String component
)

Acquire a lock for a component

Implementation

Future<SignalLock> acquireLock(String component) async {
  final lockId = await messageId();
  final lock = SignalLock(
    id: lockId,
    component: component,
    timestamp: DateTime.now(),
  );

  _locks[lockId] = lock;
  _clearAutoDisconnect();
  return lock;
}