-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
rt: split internal runtime::Handle concerns #5022
Conversation
The `runtime::Handle` struct is part of the public API but is also used internally. This has created a bit of tension. An earlier patch made defined Handle as a private struct in some cases when `rt` is not enabled. This patch splits out internal handle concerns into a new `scheduler::Handle` type, which will only be internal. This also defines a `Handle` type for each scheduler variant. Eventually, the per-scheduler `Handle` types will replace the per-scheduler `Spawner` types, but more work is needed before we can make that change.
I would suggest disabling whitespace in the diff. |
I think it might be advantageous to not have overlapping names for these handles. Could we name the internal handle "SchedulerHandle" or "InternalHandle" or something else? |
@Noah-Kennedy I can look into cleanup later, but IMO it is more idiomatic to use mod prefix. ie. |
@carllerche Good point, that is more readable. |
The `runtime::Handle` struct is part of the public API but is also used internally. This has created a bit of tension. An earlier patch made defined Handle as a private struct in some cases when `rt` is not enabled. This patch splits out internal handle concerns into a new `scheduler::Handle` type, which will only be internal. This also defines a `Handle` type for each scheduler variant. Eventually, the per-scheduler `Handle` types will replace the per-scheduler `Spawner` types, but more work is needed before we can make that change.
The
runtime::Handle
struct is part of the public API but is also used internally. This has created a bit of tension. An earlier patch made defined Handle as a private struct in some cases whenrt
is not enabled.This patch splits out internal handle concerns into a new
scheduler::Handle
type, which will only be internal. This also defines aHandle
type for each scheduler variant. Eventually, the per-schedulerHandle
types will replace the per-schedulerSpawner
types, but more work is needed before we can make that change.