Closed droundy closed 3 years ago
We could certainly have an analogous LocalContainer
struct.
Can you tell me more about your use-case? In particular, do you have types that are Sync
but not Send
, or types that are neither?
My types are neither Sync nor Send.
On Tue, Feb 20, 2018 at 3:19 AM Sergio Benitez notifications@github.com wrote:
We could certainly have an analogous LocalContainer struct.
Can you tell me more about your use-case? In particular, do you have types that are Sync but not Send, or types that are neither?
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/SergioBenitez/state/issues/3#issuecomment-366946800, or mute the thread https://github.com/notifications/unsubscribe-auth/AAIZKSpb0xUfGgPJobNlst9qZftOzImXks5tWqpTgaJpZM4SFjIV .
@vorot93 I'd really like to implement this, and I even started implementing it. The challenge is doing it in a way that doesn't result in a complete duplication of every type. That, it would be a shame to have two versions of most types in this library: one for Sync + Send
, and another without the bounds.
It would be ideal to be able to have non-Send types in thread local storage in a container. As long as they stay on the thread, that should work, right?
An alternate solution would be to create a separate thread local version of Container.