monix.execution.misc

Type members

Classlikes

@implicitNotFound("Cannot find an implicit value for CanBindLocals[${R}].\nIf ${R} is the result of a synchronous action, either build an implicit with\nCanBindLocals.synchronous or import CanBindLocals.Implicits.synchronousAsDefault.")
trait CanBindLocals[R]

Type class describing how Local binding works for specific data types.

Type class describing how Local binding works for specific data types.

This is needed because asynchronous data types, like Future, that can be waited on, should also clear the modified context after completion.

NOTE: this type class does not work for data types that suspend the execution, like Coeval or Task, because Local is meant to be used in a side effectful way. Instances of this type class can't be implemented for data types like Task, as a technical limitation, because Task would also need a suspended Context evaluation in bindContext.

Companion:
object
Companion:
class
object Local
Companion:
class
final class Local[A](default: () => A)

A Local is a ThreadLocal whose scope is flexible. The state of all Locals may be saved or restored onto the current thread by the user. This is useful for threading Locals through execution contexts.

A Local is a ThreadLocal whose scope is flexible. The state of all Locals may be saved or restored onto the current thread by the user. This is useful for threading Locals through execution contexts.

Because it's not meaningful to inherit control from two places, Locals don't have to worry about having to merge two contexts.

Note: the implementation is optimized for situations in which save and restore optimizations are dominant.

Companion:
object
final class ThreadLocal[A]

Cross-platform equivalent for java.lang.ThreadLocal, for specifying thread-local variables.

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.

Value parameters:
initial

is the initial value that this thread-local reference returns on reads in case the current thread hasn't written any values yet.

Companion:
object
Companion:
class

Deprecated types

@deprecated("Switch to monix.execution.AsyncQueue", "3.0.0")
type AsyncQueue[A] = AsyncQueue[A]
Deprecated
@deprecated("Switch to monix.execution.AsyncSemaphore", "3.0.0")
Deprecated
@deprecated("Switch to monix.execution.AsyncVar", "3.0.0")
type AsyncVar[A] = AsyncVar[A]
Deprecated

Value members

Deprecated methods

@deprecated("Switch to monix.execution.AsyncQueue", "3.0.0")
Deprecated
@deprecated("Switch to monix.execution.AsyncSemaphore", "3.0.0")
Deprecated
@deprecated("Switch to monix.execution.AsyncVar", "3.0.0")
def AsyncVar: AsyncVar.type
Deprecated