sequenceDiagram
    participant CA as Client Application
    participant RA as RedisAdapter
    participant SC as Superclass Adapter
    participant RN as Redis Node
    participant SR as Other Server Instances
    RA->>RA: fetchSockets(opts)
    RA->>RA: Prepare requestId
    RA->>RN: Publish fetchSockets request to all server instances (Set timeout 5s in response)
    RN-->>SR: Propagate request to all server instances
    loop Each Server Instance
        SR->>SR: Collect localSockets
        SR->>RN: Publish localSockets response to all server instances
    end
    RN-->>RA: Aggregate responses
    RA->>RA: If response not for this request, ignore
    RA->>RA: Resolve promise with allSockets
    RA-->>CA: Return allSockets

  1. fetchSockets(opts)
    1. RedisAdapter가 'fetchSockets' 함수를 호출합니다. 이 함수는 네트워크를 통해 소켓 정보를 가져오는 역할을 합니다.
  2. Prepare requestId
    1. RedisAdapter가 내부적으로 사용할 요청 ID(requestId)를 생성합니다. 이 ID는 요청을 구분하는 데 사용됩니다.
  3. Publish fetchSockets request to all server instances (Set timeout 5s in response)
    1. RedisAdapter가 생성한 요청 ID와 함께 'fetchSockets' 요청을 모든 서버 인스턴스에게 발행합니다. 이때, 5초의 타임아웃을 설정하여 응답을 기다립니다.
  4. Propagate request to all server instances
    1. Redis 노드가 받은 요청을 다른 모든 서버 인스턴스에 전파합니다.
  5. loop Each Server Instance
    1. 각 서버 인스턴스에서 실행되는 반복 작업입니다.
      • Collect localSockets - 각 서버 인스턴스는 로컬에 저장된 소켓 정보를 수집합니다.
      • Publish localSockets response to all server instances - 수집된 소켓 정보를 다시 Redis 노드에 발행하여, 다른 서버 인스턴스와 정보를 공유합니다.
  6. Aggregate responses
    1. Redis 노드가 모든 서버 인스턴스로부터 받은 응답을 집계합니다.
  7. If response not for this request, ignore
    1. RedisAdapter는 응답이 현재 요청과 관련 없으면 무시합니다.
  8. Resolve promise with allSockets
    1. RedisAdapter는 모든 소켓 정보를 포함한 프로미스를 완료(resolve)합니다. 이는 함수 호출 결과로 반환됩니다.
  9. Return allSockets
    1. RedisAdapter가 최종적으로 모든 소켓 정보를 클라이언트 애플리케이션에 반환합니다.