Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(GameScheduler): provide ThreadMonitor-compatible schedule method #4839

Conversation

keturn
Copy link
Member

@keturn keturn commented Aug 10, 2021

This is a proposal in hopes of moving us past the controversial point on #4799. It targets that PR's branch.

This is not a rejection of micrometer. Using micrometer instead of some of our homegrown meters is a welcome plan! But I don't think we need to do it in that PR.

@github-actions github-actions bot added the Type: Refactoring Request for or implementation of pure and automatic refactorings, e.g. renaming, to improve clarity label Aug 10, 2021
@keturn keturn added the Topic: Concurrency Requests, issues, and changes relating to threading, concurrency, parallel execution, etc. label Aug 10, 2021
Comment on lines 103 to +112

Runnable task;
if (savingGamePreview) {
GameScheduler.parallel().schedule(() -> saveGamePreviewTask(buffer, width, height));
task = () -> saveGamePreviewTask(buffer, width, height);
this.savingGamePreview = false;
} else {
GameScheduler.parallel().schedule(() -> saveScreenshotTask(buffer, width, height));
task = () -> saveScreenshotTask(buffer, width, height);
}

GameScheduler.scheduleParallel("Write screenshot", task);
Copy link
Member

Choose a reason for hiding this comment

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

would probably still opt to just use two calls to scheduleParallel. no need to be clever.

@keturn keturn merged commit 7f44559 into refactor/remove-usage-ThreadManagerSubsystem Aug 10, 2021
@keturn keturn deleted the refactor/remove-usage-ThreadManagerSubsystem-2 branch August 10, 2021 16:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Topic: Concurrency Requests, issues, and changes relating to threading, concurrency, parallel execution, etc. Type: Refactoring Request for or implementation of pure and automatic refactorings, e.g. renaming, to improve clarity
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants