Open
Conversation
Contributor
Author
|
2e519ed adds support for asynchronous process execution, streaming stdout and stderr back into a // Before main loop...
auto git_output = std::vector<std::string>();
auto p = Arcade::Process("git", std::vector<std::string> {"clone", url});
p.execute_async(buffer);
// Main loop
while (! quit_requested()) {
process_events();
// Draw loading screen...
// Draw the most recent chunk of text receievd from git
draw_text(git_output.back(), /* etc */);
refresh_screen();
} |
…h/arcade-machine into feature/process-module
Contributor
Interesing.. I don't have an env to test this on, but keen to see this in action |
…h/arcade-machine into feature/process-module
Contributor
Author
// Before main loop...
auto p = new ArcadeProcess("git", std::vector<std::string> {"clone", url});
p->execute_async();
// Main loop
while (! quit_requested()) {
process_events();
// Draw loading screen...
// Draw the most recent chunk of text receievd from git
draw_text(p->output_stream.back(), /* etc */);
refresh_screen();
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is the first step towards decoupling OS-specific process functions so they can be used from a single module across any supported OS.
I've tested on macOS and Linux, and until someone can test on Windows (or I can get access to a Windows environment) the old code paths will remain active via the conditional macros.
To avoid major problems and giant refactors, I will try and "stagger" the implementation of this over a series of updates / branches