protected function unlock(string $key)
    {
        if (!isset($this->locks[$key])) {
            throw new InvalidArgumentError('No lock was set on the given key.');
        }

        $awaitable = $this->locks[$key];
        unset($this->locks[$key]);
        $awaitable->resolve();
    }