Builders for MVar.
Value members
Concrete methods
Builds an MVar value for F
data types that are Concurrent.
Builds an MVar value for F
data types that are Concurrent.
Due to Concurrent
's capabilities, the yielded values by MVar.take
and MVar.put are cancelable.
This builder uses the Partially-Applied Type technique.
For creating an empty MVar
:
MVar[IO].empty[Int] <-> MVar.empty[IO, Int]
For creating an MVar
with an initial value:
MVar[IO].init("hello") <-> MVar.init[IO, String]("hello")
- See also
Creates a cancelable MVar
that starts as empty.
Creates a cancelable MVar
that starts as empty.
- Value Params
- F
is a Concurrent constraint, needed in order to describe cancelable operations
- See also
uncancelableEmpty for non-cancelable MVars
Creates a cancelable MVar
that's initialized to an initial
value.
Creates a cancelable MVar
that's initialized to an initial
value.
- Value Params
- F
is a Concurrent constraint, needed in order to describe cancelable operations
- initial
is a value that will be immediately available for the first
read
ortake
operation
- See also
uncancelableOf for non-cancelable MVars
Creates a non-cancelable MVar
that starts as empty.
Creates a non-cancelable MVar
that starts as empty.
The resulting MVar
has non-cancelable operations.
WARN: some Async
data types, like IO, can be cancelable,
making uncancelable
values unsafe. Such values are only useful
for optimization purposes, in cases where the use case does not
require cancellation or in cases in which an F[_]
data type
that does not support cancellation is used.
- See also
empty for creating cancelable MVars
Like uncancelableEmpty but initializes state using another effect constructor
Like uncancelableEmpty but initializes state using another effect constructor
Like uncancelableOf but initializes state using another effect constructor
Like uncancelableOf but initializes state using another effect constructor
Creates a non-cancelable MVar
that's initialized to an initial
value.
Creates a non-cancelable MVar
that's initialized to an initial
value.
The resulting MVar
has non-cancelable operations.
WARN: some Async
data types, like IO, can be cancelable,
making uncancelable
values unsafe. Such values are only useful
for optimization purposes, in cases where the use case does not
require cancellation or in cases in which an F[_]
data type
that does not support cancellation is used.
- See also
of for creating cancelable MVars