[codex] add SDK guides#461
Conversation
There was a problem hiding this comment.
Code Review
This pull request significantly expands the project's documentation by adding a general SDK overview, dedicated guides for the Python and Rust SDKs, and a comprehensive Rust API tutorial. It also updates various README files and existing tutorials with relevant links and corrects the Python version requirement. Feedback on the new Rust API tutorial points out a likely compilation error where try_join_all is used on task handles; the reviewer suggests using join_all instead because the underlying futures resolve to a result struct rather than a standard Result type.
| let handles = | ||
| try_join_all((0..cli.task_num).map(|_| ssn.run::<_, PiResponse>(&request))).await?; | ||
| let tasks = try_join_all(handles).await?; |
There was a problem hiding this comment.
The use of try_join_all on handles is likely incorrect here. According to the SDK documentation in docs/sdk/rust.md (line 93) and the description later in this tutorial (line 131), TaskFuture resolves to a TaskResult struct which contains metadata and error details, rather than a standard Rust Result.
try_join_all is designed for futures that return Result<T, E> and will fail fast if any future returns Err. If TaskFuture resolves to a struct, try_join_all will not compile. You should use join_all instead to wait for all tasks to complete and then inspect the TaskResult objects.
Additionally, ensure that join_all (and try_join_all if used for submission) are imported from the futures::future module.
| let handles = | |
| try_join_all((0..cli.task_num).map(|_| ssn.run::<_, PiResponse>(&request))).await?; | |
| let tasks = try_join_all(handles).await?; | |
| let handles = | |
| try_join_all((0..cli.task_num).map(|_| ssn.run::<_, PiResponse>(&request))).await?; | |
| let tasks = join_all(handles).await; |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Summary
docs/sdk/.flame-rspackage metadata to use it.>=3.9.Validation
git diff --checkcargo check -p flame-rs --all-targets --features macrospython3 -m compileall -q sdk/python/src/flamepycargo check -p pi --all-targetsfixes #47