Clean up and DRY IOApp implementations #4361
Draft
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.
After taking a few initial passes through the various platform
IOApp
implementations, I've come up with an approach I am going to take. I plan on adding two layers of traits for a total of three new traits. Here is a rough diagram.IOAppCommon
- This will contain method signatures common to all implementations, but with different implementation.IOAppMultiThreaded
- This will contain method signatures common between JVM and Native, as they have a lot of extra bells and whistles not present in the SJS implementation.IOAppPlatform
- This will contain platform specific method definitions, there will be three different versions of these, one per platform.I'm attempting to move things around over the course of the PR to the point where all three current
IOApp
implementations will be identical, at which point create a single definition inshared
. A few goals I have in mind as I refactor things:IOApp
to make it more approachable to people trying to understand what's going on inIOApp
.Hide methods people are better off not over-riding (such asProbably not possible due to bin-compat issues.pollingSystem
orcomputeWorkerThreadCount
) farther down the type hierarchy so library adopters will be less likely to notice / play around with them.This PR will resolve Issue 4333