Unclear how to resume iterating with `PageIterator` if the callback returns `False`
还没有人认领这个 Issue。
评估
调研方向
首先阅读 PageIterator 的实现及其回调处理,然后将所请求的行为与 issue 中的 .NET 示例进行比较。确定如何让暂停的迭代公开完成状态,并从当前位置继续;当 SDK 的行为及其用法得到明确定义和验证后,即表示完成。
由索引模型根据 Issue 内容生成。
描述
In other SDKs, the iterator class typically has a Resume method to restart the iteration where it left off, and a corresponding State property to check if the iterator has completed or not. For example, in .NET:
var pageIterator = PageIterator<Message, MessageCollectionResponse>
.CreatePageIterator(
graphClient,
messages,
(msg) =>
{
Console.WriteLine(msg.Subject);
count++;
// If we've iterated over the limit,
// stop the iteration by returning false
return count < pauseAfter;
});
await pageIterator.IterateAsync();
while (pageIterator.State != PagingState.Complete)
{
Console.WriteLine("Iteration paused for 5 seconds...");
await Task.Delay(5000);
// Reset count
count = 0;
await pageIterator.ResumeAsync();
}
Is there a way to do this in this SDK?
- 主要语言
- Python
- 星标
- 288
- 派生
- 52
- 平均合并
- 8 小时 10 分钟
- 30 天内合并 PR
- 1
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
microsoftgraph/msgraph-sdk-python-core 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 88/100
-
status:waiting-for-triage type:bug
难度 2/5 1-3 小时 新手友好度 75/100
-
status:waiting-for-triage type:bug
难度 2/5 1-3 小时 新手友好度 68/100
microsoftgraph/msgraph-sdk-python-core#1030 · 2 条评论 · 4 个 reaction ·
-
status:waiting-for-triage type:feature
难度 3/5 1-2 天 新手友好度 52/100
-
status:waiting-for-triage type:bug
难度 3/5 1-2 天 新手友好度 48/100
查看 microsoftgraph/msgraph-sdk-python-core 的全部 Issue
相似的 Issue
-
link-check link-check:sphinx-theme
难度 2/5 1-3 小时 新手友好度 72/100
-
难度 2/5 1-3 小时 新手友好度 65/100
qgis/QGIS-Documentation#11275 ·
-
bug priority:normal ready-for-dev
难度 2/5 1-3 小时 新手友好度 88/100
OpenHands/extensions#626 · 1 条评论 ·
-
难度 1/5 1 小时以内 新手友好度 90/100
CSCfi/sd-search-api#39 ·
-
难度 1/5 1 小时以内 新手友好度 90/100