Skip to content

Support async versions of tools::load() and tools::try_load()#1601

Merged
Bromeon merged 1 commit into
godot-rust:masterfrom
TitanNano:jovan/async_load
May 19, 2026
Merged

Support async versions of tools::load() and tools::try_load()#1601
Bromeon merged 1 commit into
godot-rust:masterfrom
TitanNano:jovan/async_load

Conversation

@TitanNano
Copy link
Copy Markdown
Contributor

Async versions of tools::load and tools::try_load that abstract away the complexities and pitfalls of ResourceLoaded::load_threaded_request.

The implementation depends on a SceneTree main loop. It could be expanded to make the main loop replaceable, but this would increase the complexity for the average user, while someone who uses their own main loop should be able to replicate these functions themselves.

@TitanNano TitanNano added this to the 0.5.x milestone May 14, 2026
@TitanNano TitanNano added the feature Adds functionality to the library label May 14, 2026
@TitanNano TitanNano marked this pull request as ready for review May 14, 2026 23:57
@TitanNano TitanNano added c: async Everything related to async tasks/signals c: threads Related to multithreading in Godot labels May 14, 2026
@GodotRust
Copy link
Copy Markdown

API docs are being generated and will be shortly available at: https://godot-rust.github.io/docs/gdext/pr-1601

Comment thread godot-core/src/tools/save_load.rs
Comment thread godot-core/src/tools/save_load.rs Outdated
Comment thread godot-core/src/tools/save_load.rs Outdated
Comment thread godot-core/src/tools/save_load.rs Outdated
Comment thread godot-core/src/tools/save_load.rs

save(&resource, &res_path);

// TODO(v0.6): suppress "ERROR" print in API itself.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this refer to the same issue as #1239 ?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes it has the same error print as the existing try_load.

Comment thread itest/rust/src/engine_tests/save_load_test.rs Outdated
@Bromeon Bromeon changed the title Support async versions of tools::load and tools::try_load Support async versions of tools::load() and tools::try_load() May 15, 2026
@Bromeon Bromeon added this pull request to the merge queue May 19, 2026
Merged via the queue into godot-rust:master with commit 315df8e May 19, 2026
23 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

c: async Everything related to async tasks/signals c: threads Related to multithreading in Godot feature Adds functionality to the library

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants