Module thread_local

Module thread_local 

Source
Expand description

The thread-local module provides support for managing tasks which are not Send safe, and must remain pinned to the same thread for their lifetime.

IMPORTANT: This ONLY works currently with Tokio’s rt feature, specifically due to the usage of tokio::task::LocalSet

Structs§

ThreadLocalActorSpawner
The ThreadLocalActorSpawner is responsible for spawning ThreadLocalActor instances which do not require Send restrictions and will be pinned to the current thread. You can make multiple of these to “load balance” actors across threads and can spawn multiple actors on a single one to be shared on a single thread.

Traits§

ThreadLocalActor
ThreadLocalActor defines the behavior of an Actor. It specifies the Message type, State type, and all processing logic for the actor