You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was excited to see the addition of StaticExecutor and StaticLocalExecutor optimizations, and started async-global-executor#17 with the intent to adopt both of them. However, it is unclear from the examples how exactly to use StaticLocalExecutor.
The documentation suggests using it with thread_local!, but LocalKey intentionally only offers scoped lifetime access in with in order to prevent usage from other threads. StaticLocalExecutor::spawn requires &'static self, which cannot be directly obtained from tls. Does that lifetime have to be 'static? If so, how is this intended to be used?
Thanks!
The text was updated successfully, but these errors were encountered:
I was excited to see the addition of
StaticExecutor
andStaticLocalExecutor
optimizations, and started async-global-executor#17 with the intent to adopt both of them. However, it is unclear from the examples how exactly to use StaticLocalExecutor.The documentation suggests using it with
thread_local!
, but LocalKey intentionally only offers scoped lifetime access inwith
in order to prevent usage from other threads.StaticLocalExecutor::spawn
requires&'static self
, which cannot be directly obtained from tls. Does that lifetime have to be'static
? If so, how is this intended to be used?Thanks!
The text was updated successfully, but these errors were encountered: