-
Notifications
You must be signed in to change notification settings - Fork 117
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
Support for loop singletons #147
Comments
@alexcrichton, you said you wanted to discuss something here? Is the #149 OK with you? Or, do you have an idea for a nicer solution for the problem? Thank you |
Oh yes don't worry I haven't forgotten about this. I just wanted to collect my thoughts. I'll post more tomorrow. |
Ok, some thoughts of mine:
|
I believe the Just out of curiosity, is something wrong with |
For me at least |
As #149 got merged, should we close this, or do we want to have an implementation that actually uses it, to confirm it would work? Or, should I close it, as the author of this? |
Closing sounds good to me! |
Hello
I'd like to have a singleton task in a loop. However, as it is a library, I don't want to make the user of the library manage it manually. So I want to have some way to associate information with a
Core
, so I can see if I already created the singleton or not.My current motivation is to have a task that delegates unix signals to multiple futures inside the loop, more details can be found here: alexcrichton/tokio-signal#5.
I have two proposals how to do that (I'm going to make merge requests for them in a second). I would prefer the
AnyMap
one, as it seems to be more general and cleaner to use. The other is more lightweight and doesn't bring any additional dependency. Either one is good enough for my current need, but I'm not against merging both, as they can be used for potentially different things.Any feedback is welcome (I'm a bit new to Rust, so I still have a lot to learn).
The text was updated successfully, but these errors were encountered: