final class ThreadLocal[A] extends AnyRef
Cross-platform equivalent for java.lang.ThreadLocal
,
for specifying thread-local variables.
These variables differ from their normal counterparts in that each thread that accesses one (via its ThreadLocal#get or ThreadLocal#set method) has its own, independently initialized copy of the variable.
- Source
- ThreadLocal.scala
- Alphabetic
- By Inheritance
- ThreadLocal
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Value Members
-
def
get(): A
Returns the value in the current thread's copy of this thread-local variable.
Returns the value in the current thread's copy of this thread-local variable. If the variable has no value for the current thread, it is initialized with the initial value specified in the constructor.
- returns
the current thread's value of this thread-local
- val initial: A
-
def
reset(): Unit
Removes the current thread's value for this thread-local variable.
-
def
set(value: A): Unit
Sets the current thread's copy of this thread-local variable to the specified value.
Sets the current thread's copy of this thread-local variable to the specified value.
- value
the value to be stored in the current thread's copy of this thread-local.
This is the API documentation for the Monix library.
Package Overview
monix.execution exposes lower level primitives for dealing with asynchronous execution:
Atomic
types, as alternative tojava.util.concurrent.atomic
monix.eval is for dealing with evaluation of results, thus exposing Task and Coeval.
monix.reactive exposes the
Observable
pattern:Observable
implementationsmonix.types implements type-class shims, to be translated to type-classes provided by libraries such as Cats or Scalaz.
monix.cats is the optional integration with the Cats library, providing translations for the types described in
monix.types
.monix.scalaz is the optional integration with the Scalaz library, providing translations for the types described in
monix.types
.