atlanticaccent / starsector-mod-manager-rust

A mod manager for Starsector, a space fleet-battle and economics simulator. This time written in Rust.
https://atlanticaccent.github.io/starsector-mod-manager-rust/
MIT License
33 stars 1 forks source link

Make I/O intensive operations async #15

Closed atlanticaccent closed 3 years ago

atlanticaccent commented 3 years ago

Archive decompression, file copying, etc are all time consuming, and will block the main application event loop until complete. Using something like Command::perform is the intended route, though this has been somewhat difficult to work with up till now.

atlanticaccent commented 3 years ago

The issue with being unable to dispatch Commands stemmed from a misunderstanding of how the component update loop worked. If a parent component receives a message for a child component, it should itself return the command returned from executing the update function on the child component.