@Override
            public long next() {
                while (iterator.hasNext()) {
                    Long userId = null;
                    for (UserSession session : iterator.next()
                            .getDeviceTypeToSession()
                            .values()) {
                        if (closeOrUpdateSession(session, now) && userId == null) {
                            userId = session.getUserId();
                        }
                    }
                    if (userId != null) {
                        return userId;
                    }
                }
                return -1;
            }
@author James Chen
@implNote Strategy Candidates: 1. Refresh the heartbeat info in Redis when a user sends a
          heartbeat request: It is a disaster for performance when there are many online users
          <p>
          2. Store heartbeat requests in a MPSC queue, and merge them into one Redis command and
          send them to Redis periodically: Waste memory and loss performance due to the
          operations on the MPSC queue
          <p>
          3. (Adopted) Do not store the requests, and just iterate over the original online user
          map to get a snapshot of the online users that need to update online status (go offline
          or refresh heartbeat)
turms-gateway/src/main/java/im/turms/gateway/domain/session/manager/HeartbeatManager.java