package concurrent
- Alphabetic
- Public
- All
Type Members
-
trait
Agent[F[_], A] extends SerialAgent[F, A]
A mutable atomic reference augmented with effectual operations.
A mutable atomic reference augmented with effectual operations. Can be thought as TF version of zio.RefM
-
trait
Atom[+F[_], A] extends AnyRef
a middleground between cats.concurrent.Ref and zio.Ref
- trait AtomInstances extends AnyRef
- sealed trait Exit[+E, +A] extends AnyRef
-
trait
MakeAgent[I[_], F[_]] extends AnyRef
A creator of tofu.concurrent.Agent that supports effectual construction.
A creator of tofu.concurrent.Agent that supports effectual construction.
- I
effect for creation of agent
- F
effect on which agent will be run
- trait MakeAtom[I[_], F[_]] extends AnyRef
-
trait
MakePermit[I[_], F[_]] extends AnyRef
A creator of tofu.concurrent.Permit that supports effectful construction
A creator of tofu.concurrent.Permit that supports effectful construction
- I
effect for creation of agent
- F
effect on which agent will run
- trait MakeQVar[I[_], F[_]] extends AnyRef
-
trait
MakeSerialAgent[I[_], F[_]] extends AnyRef
A creator of tofu.concurrent.SerialAgent that supports effectful construction
A creator of tofu.concurrent.SerialAgent that supports effectful construction
- I
effect for creation of agent
- F
effect on which agent will run
-
trait
Permit[F[_]] extends AnyRef
A purely functional semaphore.
A purely functional semaphore. A semaphore has a non-negative number of permits available. Acquiring a permit decrements the current number of permits and releasing a permit increases the current number of permits. An acquire that occurs when there are no permits available results in semantic blocking until a permit becomes available. Blocking
withPermitare cancelable. - final case class QAtom[F[_], A](qvar: QVar[F, A])(implicit evidence$1: Applicative[F], evidence$2: Guarantee[F]) extends Atom[F, A] with Product with Serializable
-
trait
QVar[+F[_], A] extends AnyRef
a middleground between cats.concurrent.MVar and zio.Queue.bounded(1)
- trait QVarInstances extends AnyRef
-
trait
SerialAgent[F[_], A] extends AnyRef
A less powerful version of tofu.concurrent.Agent.
A less powerful version of tofu.concurrent.Agent. It does not have the
fireUpdateMmethod and thus can be created for greater variety ofF
Value Members
- object Agent
- object Atom extends AtomInstances
- object Exit
-
object
MakeAgent extends MakeAgentInstance
A helper for creating instances of tofu.concurrent.Agent that use different effects during construction and work.
A helper for creating instances of tofu.concurrent.Agent that use different effects during construction and work. If you want to use same effect to construct and run
Agentuse tofu.concurrent.AgentsSample usage:
import cats.Monad import cats.implicits._ import cats.syntax.flatMap._ import cats.effect.Sync import tofu.Fire import tofu.concurrent.{Agents, MakeAgent, MakeRef, MakeSemaphore, Refs, Semaphores} import tofu.common.Console def example[F[_]: Agents: Fire: Monad: Console: Sync: Refs: Semaphores]( implicit refs: MakeRef[Option, F], sems: MakeSemaphore[Option, F] ): F[Unit] = for { _ <- Monad[F].unit agent <- MakeAgent[Option, F].of(42).map(Monad[F].pure(_)).getOrElse(Agents[F].of(42)) newValue <- agent.updateM(a => Console[F].putStrLn(s"current value is $a") *> Monad[F].pure(a + 27)) _ <- Console[F].putStrLn(s"new value is $newValue") // new value is 69 } yield ()
- object MakeAtom extends MakeAtomInstance
-
object
MakePermit extends MakePermitInstance
A helper for creating instances of tofu.concurrent.Permit that use different effects during construction and work.
A helper for creating instances of tofu.concurrent.Permit that use different effects during construction and work. If you want to use same effect to construct and run
Permituse tofu.concurrent.Permit.Make - object MakeQVar extends MakeQVarInstance
-
object
MakeSerialAgent extends MakeSerialAgentInstance
A helper for creating instances of tofu.concurrent.SerialAgent that use different effects during construction and work.
A helper for creating instances of tofu.concurrent.SerialAgent that use different effects during construction and work. If you want to use same effect to construct and run
SerialAgentuse tofu.concurrent.SerialAgentsSample usage:
import cats.Monad import cats.implicits._ import cats.syntax.flatMap._ import cats.effect.Sync import tofu.Fire import tofu.concurrent.{SerialAgents, MakeSerialAgent, MakeRef, MakeSemaphore, Refs, Semaphores} import tofu.common.Console def example[F[_]: SerialAgents: Monad: Console: Sync: Refs: Semaphores]( implicit refs: MakeRef[Option, F], sems: MakeSemaphore[Option, F] ): F[Unit] = for { _ <- Monad[F].unit serialAgent <- MakeSerialAgent[Option, F].of(42).map(Monad[F].pure(_)).getOrElse(SerialAgents[F].of(42)) newValue <- serialAgent.updateM(a => Console[F].putStrLn(s"current value is $a") *> Monad[F].pure(a + 27)) _ <- Console[F].putStrLn(s"new value is $newValue") // new value is 69 } yield ()
- object Permit
- object QVar extends QVarInstances
- object QVars
- object SerialAgent
Deprecated Value Members
-
object
Agents
- Annotations
- @deprecated
- Deprecated
(Since version 0.10.4) Use Agent.Make
-
object
SerialAgents
- Annotations
- @deprecated
- Deprecated
(Since version 0.10.4) Use SerialAgent.Make