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
- Protected
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.catnap exposes pure abstractions built on top of the Cats-Effect type classes:
monix.eval is for dealing with evaluation of results, thus exposing Task and Coeval.
monix.reactive exposes the
Observable
pattern:Observable
implementationsmonix.tail exposes Iterant for purely functional pull based streaming:
Batch
andBatchCursor
, the alternatives to Scala'sIterable
andIterator
respectively that we are using within Iterant's encodingYou can control evaluation with type you choose - be it Task, Coeval, cats.effect.IO or your own as long as you provide correct cats-effect or cats typeclass instance.