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

Sync / Async ambiguity in StorageTaskCallback callbacks #122

Closed
Parsonswy opened this issue Aug 3, 2020 · 2 comments
Closed

Sync / Async ambiguity in StorageTaskCallback callbacks #122

Parsonswy opened this issue Aug 3, 2020 · 2 comments
Assignees
Labels
enhancement New feature or request

Comments

@Parsonswy
Copy link
Member

No explicit decision was ever made on whether StorageTaskCallbacks should be executed on an async thread, or if the callback needs to run on the Bukkit thread so it can interact with API functions. Given that storage tasks can be invoked synchronously or asynchronously, this is not as trivial as calling .runTask() vs .runTaskAsync() because a storage task that gets invoked synchronously might be expected to block until the provied StorageTaskCallback is complete, but using runTask() would cause a pre-mature return before all post-processing was complete. We need to also be able to detect and distinguish, either by argument or by convention, immediately invoked synchronous callback tasks and deferred, synchronous tasks.

@Parsonswy Parsonswy added the enhancement New feature or request label Aug 3, 2020
@Parsonswy Parsonswy added this to the Initial Release milestone Aug 3, 2020
@Parsonswy Parsonswy self-assigned this Aug 3, 2020
@Parsonswy
Copy link
Member Author

CompletableFutures are strictly better here and I don't remember why I didn't choose to use the before. Migrating Storage tasks to use CompletableFutures.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant