Hi,
If one has many schedules (eg a few thousand), then how does one get a list of all of them? Assuming it is a bad idea to set the pagesize to a very large number. Thanks!
Albert
Hi Albert,
New page is fetched on demand as you call iterator.HasNext()
.
See the implementation details below:
func (sc *scheduleClient) List(ctx context.Context, options ScheduleListOptions) (ScheduleListIterator, error) {
paginate := func(nextToken []byte) (*workflowservice.ListSchedulesResponse, error) {
grpcCtx, cancel := newGRPCContext(ctx, defaultGrpcRetryParameters(ctx))
defer cancel()
request := &workflowservice.ListSchedulesRequest{
Namespace: sc.workflowClient.namespace,
MaximumPageSize: int32(options.PageSize),
NextPageToken: nextToken,
}
return sc.workflowClient.workflowService.ListSchedules(grpcCtx, request)
}
return &scheduleListIteratorImpl{
paginate: paginate,
}, nil
}
func (iter *scheduleListIteratorImpl) HasNext() bool {
if iter.err == nil {
This file has been truncated. show original