본문으로 건너뛰기

browse_next

노드 개수가 서버의 단일 페이지 제한(기본적으로 한 번의 요청당 최대 1000개)을 초과할 경우, 서버는 BrowseResult에 비어 있지 않은 continuation_point (다음 페이지로 넘어가는 토큰)을 반환합니다. 를 사용하여 browse_next 다음 페이지를 불러옵니다.

사전 읽기
  • continuation_point를 얻으려면 반드시 다음을 사용해야 합니다. browse_with_paging, 일반 browse 폐기됨 CP (References만 가져오고, 계속 토큰는 읽지 않음).

서명​

def browse_next(self,
continuation_point: Optional[bytes],
release: bool = False) -> BrowsePage: ...
매개변수설명
continuation_point이전 browse_with_paging / browse_next 반환된 계속 토큰 (바이트)
releaseTrue = 추가 변환 포기, 서버 측에서 리소스 해제 (references 반환하지 않음)

BrowsePage 필드​

@dataclass
class BrowsePage:
references: List[Reference] # 기본값은 None이며, 생성 후에는 []이 됩니다.
continuation_point: Optional[bytes] = None # 'None'은 더 이상 페이지가 없음을 의미합니다.

완전한 페이지 넘기기 예시​

page = ua.browse_with_paging("ns=2;s=BigFolder")
all_refs = list(page.references)

while page.continuation_point is not None:
page = ua.browse_next(page.continuation_point)
all_refs.extend(page.references)

print(f"Total {len(all_refs)} children")

능동적 해제 (서버 리소스 절약)​

서버는 각 유지 ContinuationPoint 관리 상태를 처리하며 자원을 차지합니다. 도중에 더 이상 처리하지 않으려면 명시적으로 release=True 해제해야 합니다:

ua.browse_next(page.continuation_point, release=True)

release 모드에서는 서버 측에서 참조만 해제하고 더 이상 참조를 부여하지 않으므로, 반환되는 값은 빈 목록이며 BrowsePage.references , continuation_point 는 입니다 None.SDK 서버 측에서 해제되지 않은 메모리를 언제 회수하는지 모르겠네요. CP —— 그건 서버 측의 문제입니다. 리소스를 확실하게 반환하려면 명시적으로 처리해야 합니다 release=True.

주의​

  • continuation_point 불투명합니다 bytes, 수정하지 마십시오 / 분석
  • 페이지를 넘길 때는 항상가장 최근의browse_next 반환된 continuation_point 계속 (페이지를 한 장 넘길 때마다 서버에서 새로운 데이터를 반환합니다 CP)
  • CP 수량 상한선과 회수 시점은 서버 측에서 결정하며, 클라이언트 측에서는 단순히 SDK 데이터를 전달할 뿐입니다.

다음 단계​