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

Question: Determining which worker ID that a task is running on #815

Closed
mmstick opened this issue Dec 26, 2018 · 4 comments
Closed

Question: Determining which worker ID that a task is running on #815

mmstick opened this issue Dec 26, 2018 · 4 comments
Labels
C-enhancement Category: A PR with an enhancement or bugfix.

Comments

@mmstick
Copy link

mmstick commented Dec 26, 2018

Is there a means to get the ID of a worker that is spawned on a Runtime?

oneshot::spawn_fn(
    || {
        eprintln!("processing on worker {}", ???);
        doing_thing()
    },
    &DefaultExecutor::current()
)
@ghost
Copy link

ghost commented Dec 26, 2018

This is not possible. Why do you need to get the ID of the worker? Is it just for debugging or do you have another use case in mind?

@mmstick
Copy link
Author

mmstick commented Dec 27, 2018

Debugging is one use case, as is displaying to the end user that tasks are being processed on multiple threads.

@carllerche
Copy link
Member

I think the right way to provide this info for debugging will be via Tokio trace here.

@hawkw hawkw added the C-enhancement Category: A PR with an enhancement or bugfix. label Apr 12, 2019
@carllerche
Copy link
Member

Tracking this in #1186.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-enhancement Category: A PR with an enhancement or bugfix.
Projects
None yet
Development

No branches or pull requests

3 participants