Packages

object MVar

Source
MVar.scala
Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. MVar
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Type Members

  1. final class ApplyBuilders[F[_]] extends AnyVal

    Returned by the apply builder.

Value Members

  1. def apply[F[_]](implicit F: OrElse[Concurrent[F], Async[F]]): ApplyBuilders[F]

    Builds an MVar value for F data types that are either Concurrent or Async.

    Builds an MVar value for F data types that are either Concurrent or Async.

    Due to Concurrent's capabilities, the yielded values by MVar.take and MVar.put are cancelable. For Async however this isn't guaranteed, although the implementation does rely on bracket, so it might be.

    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].of("hello") <-> MVar.of[IO, String]("hello")

    See also

    of and empty

  2. def empty[F[_], A](ps: PaddingStrategy = NoPadding)(implicit F: OrElse[Concurrent[F], Async[F]], cs: ContextShift[F]): F[MVar[F, A]]

    Builds an empty MVar instance.

  3. def of[F[_], A](initial: A, ps: PaddingStrategy = NoPadding)(implicit F: OrElse[Concurrent[F], Async[F]], cs: ContextShift[F]): F[MVar[F, A]]

    Builds an MVar instance with an initial value.