object ZSTM extends Serializable
- Alphabetic
- By Inheritance
- ZSTM
- Serializable
- Serializable
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Type Members
- final class AccessPartiallyApplied[R] extends AnyVal
- final class AccessSTMPartiallyApplied[R] extends AnyVal
- final class IfSTM[R, E] extends AnyRef
- final class ServiceAtPartiallyApplied[Service] extends AnyVal
- final class ServiceWithPartiallyApplied[Service] extends AnyVal
- final class UnlessSTM[R, E] extends AnyRef
- final class UpdateService[-R, +E, +A, M] extends AnyRef
- final class UpdateServiceAt[-R, +E, +A, Service] extends AnyVal
- final class WhenSTM[R, E] extends AnyRef
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
absolve[R, E, A](z: ZSTM[R, E, Either[E, A]]): ZSTM[R, E, A]
Submerges the error case of an
Eitherinto theSTM.Submerges the error case of an
Eitherinto theSTM. The inverse operation ofSTM.either. -
def
access[R]: AccessPartiallyApplied[R]
Accesses the environment of the transaction.
-
def
accessSTM[R]: AccessSTMPartiallyApplied[R]
Accesses the environment of the transaction to perform a transaction.
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
atomically[R, E, A](stm: ZSTM[R, E, A])(implicit trace: ZTraceElement): ZIO[R, E, A]
Atomically performs a batch of operations in a single transaction.
-
def
attempt[A](a: ⇒ A): STM[Throwable, A]
Creates an
STMvalue from a partial (but pure) function. -
def
check[R](p: ⇒ Boolean): URSTM[R, Unit]
Checks the condition, and if it's true, returns unit, otherwise, retries.
-
def
clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()
-
def
collect[R, E, A, B, Collection[+Element] <: Iterable[Element]](in: Collection[A])(f: (A) ⇒ ZSTM[R, Option[E], B])(implicit bf: zio.BuildFrom[Collection[A], B, Collection[B]]): ZSTM[R, E, Collection[B]]
Evaluate each effect in the structure from left to right, collecting the the successful values and discarding the empty cases.
-
def
collectAll[R, E, A](in: Set[ZSTM[R, E, A]]): ZSTM[R, E, Set[A]]
Collects all the transactional effects in a set, returning a single transactional effect that produces a set of values.
-
def
collectAll[R, E, A, Collection[+Element] <: Iterable[Element]](in: Collection[ZSTM[R, E, A]])(implicit bf: zio.BuildFrom[Collection[ZSTM[R, E, A]], A, Collection[A]]): ZSTM[R, E, Collection[A]]
Collects all the transactional effects in a collection, returning a single transactional effect that produces a collection of values.
-
def
collectAllDiscard[R, E, A](in: Iterable[ZSTM[R, E, A]]): ZSTM[R, E, Unit]
Collects all the transactional effects, returning a single transactional effect that produces
Unit.Collects all the transactional effects, returning a single transactional effect that produces
Unit.Equivalent to
collectAll(i).unit, but without the cost of building the list of results. -
def
collectFirst[R, E, A, B](as: Iterable[A])(f: (A) ⇒ ZSTM[R, E, Option[B]]): ZSTM[R, E, Option[B]]
Collects the first element of the
Iterable[A]for which the effectual functionfreturnsSome. -
def
cond[E, A](predicate: Boolean, result: ⇒ A, error: ⇒ E): STM[E, A]
Similar to Either.cond, evaluate the predicate, return the given A as success if predicate returns true, and the given E as error otherwise
-
def
die(t: ⇒ Throwable): USTM[Nothing]
Kills the fiber running the effect.
-
def
dieMessage(m: ⇒ String): USTM[Nothing]
Kills the fiber running the effect with a
RuntimeExceptionthat contains the specified message. -
def
done[R, E, A](exit: ⇒ TExit[E, A]): ZSTM[R, E, A]
Returns a value modelled on provided exit status.
-
def
environment[R]: URSTM[R, R]
Retrieves the environment inside an stm.
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
exists[R, E, A](as: Iterable[A])(f: (A) ⇒ ZSTM[R, E, Boolean]): ZSTM[R, E, Boolean]
Determines whether any element of the
Iterable[A]satisfies the effectual predicatef. -
def
fail[E](e: ⇒ E): STM[E, Nothing]
Returns a value that models failure in the transaction.
-
val
fiberId: USTM[FiberId]
Returns the fiber id of the fiber committing the transaction.
-
def
filter[R, E, A](as: Set[A])(f: (A) ⇒ ZSTM[R, E, Boolean]): ZSTM[R, E, Set[A]]
Filters the set using the specified effectual predicate.
-
def
filter[R, E, A, Collection[+Element] <: Iterable[Element]](as: Collection[A])(f: (A) ⇒ ZSTM[R, E, Boolean])(implicit bf: zio.BuildFrom[Collection[A], A, Collection[A]]): ZSTM[R, E, Collection[A]]
Filters the collection using the specified effectual predicate.
-
def
filterNot[R, E, A](as: Set[A])(f: (A) ⇒ ZSTM[R, E, Boolean]): ZSTM[R, E, Set[A]]
Filters the set using the specified effectual predicate, removing all elements that satisfy the predicate.
-
def
filterNot[R, E, A, Collection[+Element] <: Iterable[Element]](as: Collection[A])(f: (A) ⇒ ZSTM[R, E, Boolean])(implicit bf: zio.BuildFrom[Collection[A], A, Collection[A]]): ZSTM[R, E, Collection[A]]
Filters the collection using the specified effectual predicate, removing all elements that satisfy the predicate.
-
def
finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
def
flatten[R, E, A](tx: ZSTM[R, E, ZSTM[R, E, A]]): ZSTM[R, E, A]
Returns an effect that first executes the outer effect, and then executes the inner effect, returning the value from the inner effect, and effectively flattening a nested effect.
-
def
foldLeft[R, E, S, A](in: Iterable[A])(zero: S)(f: (S, A) ⇒ ZSTM[R, E, S]): ZSTM[R, E, S]
Folds an Iterable[A] using an effectual function f, working sequentially from left to right.
-
def
foldRight[R, E, S, A](in: Iterable[A])(zero: S)(f: (A, S) ⇒ ZSTM[R, E, S]): ZSTM[R, E, S]
Folds an Iterable[A] using an effectual function f, working sequentially from right to left.
-
def
forall[R, E, A](as: Iterable[A])(f: (A) ⇒ ZSTM[R, E, Boolean]): ZSTM[R, E, Boolean]
Determines whether all elements of the
Iterable[A]satisfy the effectual predicatef. -
def
foreach[R, E, A, B](in: Set[A])(f: (A) ⇒ ZSTM[R, E, B]): ZSTM[R, E, Set[B]]
Applies the function
fto each element of theSet[A]and returns a transactional effect that produces a newSet[B]. -
def
foreach[R, E, A, B, Collection[+Element] <: Iterable[Element]](in: Collection[A])(f: (A) ⇒ ZSTM[R, E, B])(implicit bf: zio.BuildFrom[Collection[A], B, Collection[B]]): ZSTM[R, E, Collection[B]]
Applies the function
fto each element of theCollection[A]and returns a transactional effect that produces a newCollection[B]. -
def
foreachDiscard[R, E, A](in: Iterable[A])(f: (A) ⇒ ZSTM[R, E, Any]): ZSTM[R, E, Unit]
Applies the function
fto each element of theIterable[A]and returns a transactional effect that producesUnit.Applies the function
fto each element of theIterable[A]and returns a transactional effect that producesUnit.Equivalent to
foreach(as)(f).unit, but without the cost of building the list of results. -
def
fromEither[E, A](e: ⇒ Either[E, A]): STM[E, A]
Lifts an
Eitherinto aSTM. -
def
fromOption[A](v: ⇒ Option[A]): STM[Option[Nothing], A]
Lifts an
Optioninto aSTM. -
def
fromTry[A](a: ⇒ Try[A]): TaskSTM[A]
Lifts a
Tryinto aSTM. -
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
def
ifSTM[R, E](b: ZSTM[R, E, Boolean]): IfSTM[R, E]
Runs
onTrueif the result ofbistrueandonFalseotherwise. -
lazy val
interrupt: USTM[Nothing]
Interrupts the fiber running the effect.
-
def
interruptAs(fiberId: ⇒ FiberId): USTM[Nothing]
Interrupts the fiber running the effect with the specified fiber id.
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
def
iterate[R, E, S](initial: S)(cont: (S) ⇒ Boolean)(body: (S) ⇒ ZSTM[R, E, S]): ZSTM[R, E, S]
Iterates with the specified transactional function.
Iterates with the specified transactional function. The moral equivalent of:
var s = initial while (cont(s)) { s = body(s) } s
-
def
left[A](a: ⇒ A): USTM[Either[A, Nothing]]
Returns an effect with the value on the left part.
-
def
loop[R, E, A, S](initial: S)(cont: (S) ⇒ Boolean, inc: (S) ⇒ S)(body: (S) ⇒ ZSTM[R, E, A]): ZSTM[R, E, List[A]]
Loops with the specified transactional function, collecting the results into a list.
Loops with the specified transactional function, collecting the results into a list. The moral equivalent of:
var s = initial var as = List.empty[A] while (cont(s)) { as = body(s) :: as s = inc(s) } as.reverse
-
def
loopDiscard[R, E, S](initial: S)(cont: (S) ⇒ Boolean, inc: (S) ⇒ S)(body: (S) ⇒ ZSTM[R, E, Any]): ZSTM[R, E, Unit]
Loops with the specified transactional function purely for its transactional effects.
Loops with the specified transactional function purely for its transactional effects. The moral equivalent of:
var s = initial while (cont(s)) { body(s) s = inc(s) }
-
def
mergeAll[R, E, A, B](in: Iterable[ZSTM[R, E, A]])(zero: B)(f: (B, A) ⇒ B): ZSTM[R, E, B]
Merges an
Iterable[ZSTM]to a single ZSTM, working sequentially. -
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
val
none: USTM[Option[Nothing]]
Returns an effect with the empty value.
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
def
partition[R, E, A, B](in: Iterable[A])(f: (A) ⇒ ZSTM[R, E, B])(implicit ev: CanFail[E]): ZSTM[R, Nothing, (Iterable[E], Iterable[B])]
Feeds elements of type
Ato a functionfthat returns an effect.Feeds elements of type
Ato a functionfthat returns an effect. Collects all successes and failures in a tupled fashion. -
def
reduceAll[R, R1 <: R, E, A](a: ZSTM[R, E, A], as: Iterable[ZSTM[R1, E, A]])(f: (A, A) ⇒ A): ZSTM[R1, E, A]
Reduces an
Iterable[ZSTM]to a singleZSTM, working sequentially. -
def
replicate[R, E, A](n: Int)(tx: ZSTM[R, E, A]): Iterable[ZSTM[R, E, A]]
Replicates the given effect n times.
Replicates the given effect n times. If 0 or negative numbers are given, an empty
Iterablewill return. -
def
replicateSTM[R, E, A](n: Int)(transaction: ZSTM[R, E, A]): ZSTM[R, E, Iterable[A]]
Performs this transaction the specified number of times and collects the results.
-
def
replicateSTMDiscard[R, E, A](n: Int)(transaction: ZSTM[R, E, A]): ZSTM[R, E, Unit]
Performs this transaction the specified number of times, discarding the results.
-
val
retry: USTM[Nothing]
Abort and retry the whole transaction when any of the underlying transactional variables have changed.
-
def
right[A](a: ⇒ A): USTM[Either[Nothing, A]]
Returns an effect with the value on the right part.
-
def
service[A](implicit arg0: zio.Tag[A]): ZSTM[Has[A], Nothing, A]
Accesses the specified service in the environment of the effect.
-
def
serviceAt[Service]: ServiceAtPartiallyApplied[Service]
Accesses the service corresponding to the specified key in the environment.
-
def
serviceWith[Service]: ServiceWithPartiallyApplied[Service]
Effectfully accesses the specified service in the environment of the effect.
-
def
some[A](a: ⇒ A): USTM[Option[A]]
Returns an effect with the optional value.
-
def
succeed[A](a: ⇒ A): USTM[A]
Returns an
STMeffect that succeeds with the specified value. -
def
suspend[R, E, A](stm: ⇒ ZSTM[R, E, A]): ZSTM[R, E, A]
Suspends creation of the specified transaction lazily.
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toString(): String
- Definition Classes
- AnyRef → Any
-
val
unit: USTM[Unit]
Returns an
STMeffect that succeeds withUnit. -
def
unless[R, E, A](b: ⇒ Boolean)(stm: ⇒ ZSTM[R, E, A]): ZSTM[R, E, Option[A]]
The moral equivalent of
if (!p) exp -
def
unlessSTM[R, E](b: ZSTM[R, E, Boolean]): UnlessSTM[R, E]
The moral equivalent of
if (!p) expwhenphas side-effects -
def
validate[R, E, A, B](in: NonEmptyChunk[A])(f: (A) ⇒ ZSTM[R, E, B])(implicit ev: CanFail[E]): ZSTM[R, ::[E], NonEmptyChunk[B]]
Feeds elements of type
Atofand accumulates all errors in error channel or successes in success channel.Feeds elements of type
Atofand accumulates all errors in error channel or successes in success channel.This combinator is lossy meaning that if there are errors all successes will be lost. To retain all information please use partition.
-
def
validate[R, E, A, B, Collection[+Element] <: Iterable[Element]](in: Collection[A])(f: (A) ⇒ ZSTM[R, E, B])(implicit bf: zio.BuildFrom[Collection[A], B, Collection[B]], ev: CanFail[E]): ZSTM[R, ::[E], Collection[B]]
Feeds elements of type
Atofand accumulates all errors in error channel or successes in success channel.Feeds elements of type
Atofand accumulates all errors in error channel or successes in success channel.This combinator is lossy meaning that if there are errors all successes will be lost. To retain all information please use partition.
-
def
validateFirst[R, E, A, B, Collection[+Element] <: Iterable[Element]](in: Collection[A])(f: (A) ⇒ ZSTM[R, E, B])(implicit bf: zio.BuildFrom[Collection[A], E, Collection[E]], ev: CanFail[E]): ZSTM[R, Collection[E], B]
Feeds elements of type
Atofuntil it succeeds.Feeds elements of type
Atofuntil it succeeds. Returns first success or the accumulation of all errors. -
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()
-
def
when[R, E, A](b: ⇒ Boolean)(stm: ⇒ ZSTM[R, E, A]): ZSTM[R, E, Option[A]]
The moral equivalent of
if (p) exp -
def
whenCase[R, E, A, B](a: ⇒ A)(pf: PartialFunction[A, ZSTM[R, E, B]]): ZSTM[R, E, Option[B]]
Runs an effect when the supplied
PartialFunctionmatches for the given value, otherwise does nothing. -
def
whenCaseSTM[R, E, A, B](a: ZSTM[R, E, A])(pf: PartialFunction[A, ZSTM[R, E, B]]): ZSTM[R, E, Option[B]]
Runs an effect when the supplied
PartialFunctionmatches for the given effectful value, otherwise does nothing. -
def
whenSTM[R, E](b: ZSTM[R, E, Boolean]): WhenSTM[R, E]
The moral equivalent of
if (p) expwhenphas side-effects
Deprecated Value Members
-
def
accessM[R]: AccessSTMPartiallyApplied[R]
Accesses the environment of the transaction to perform a transaction.
Accesses the environment of the transaction to perform a transaction.
- Annotations
- @deprecated
- Deprecated
(Since version 2.0.0) use accessSTM
-
def
collectAll_[R, E, A](in: Iterable[ZSTM[R, E, A]]): ZSTM[R, E, Unit]
Collects all the transactional effects, returning a single transactional effect that produces
Unit.Collects all the transactional effects, returning a single transactional effect that produces
Unit.Equivalent to
collectAll(i).unit, but without the cost of building the list of results.- Annotations
- @deprecated
- Deprecated
(Since version 2.0.0) use collectAllDiscard
-
def
foreach_[R, E, A](in: Iterable[A])(f: (A) ⇒ ZSTM[R, E, Any]): ZSTM[R, E, Unit]
Applies the function
fto each element of theIterable[A]and returns a transactional effect that producesUnit.Applies the function
fto each element of theIterable[A]and returns a transactional effect that producesUnit.Equivalent to
foreach(as)(f).unit, but without the cost of building the list of results.- Annotations
- @deprecated
- Deprecated
(Since version 2.0.0) use foreachDiscard
-
def
fromFunction[R, A](f: (R) ⇒ A): URSTM[R, A]
Lifts a function
R => Ainto aURSTM[R, A].Lifts a function
R => Ainto aURSTM[R, A].- Annotations
- @deprecated
- Deprecated
(Since version 2.0.0) use access
-
def
fromFunctionM[R, E, A](f: (R) ⇒ STM[E, A]): ZSTM[R, E, A]
Lifts an effectful function whose effect requires no environment into an effect that requires the input to the function.
Lifts an effectful function whose effect requires no environment into an effect that requires the input to the function.
- Annotations
- @deprecated
- Deprecated
(Since version 2.0.0) use accessSTM
-
def
ifM[R, E](b: ZSTM[R, E, Boolean]): IfSTM[R, E]
Runs
onTrueif the result ofbistrueandonFalseotherwise.Runs
onTrueif the result ofbistrueandonFalseotherwise.- Annotations
- @deprecated
- Deprecated
(Since version 2.0.0) use ifSTM
-
def
loop_[R, E, S](initial: S)(cont: (S) ⇒ Boolean, inc: (S) ⇒ S)(body: (S) ⇒ ZSTM[R, E, Any]): ZSTM[R, E, Unit]
Loops with the specified transactional function purely for its transactional effects.
Loops with the specified transactional function purely for its transactional effects. The moral equivalent of:
var s = initial while (cont(s)) { body(s) s = inc(s) }
- Annotations
- @deprecated
- Deprecated
(Since version 2.0.0) use loopDiscard
-
def
mapN[R, E, A, B, C, D, F](tx1: ZSTM[R, E, A], tx2: ZSTM[R, E, B], tx3: ZSTM[R, E, C], tx4: ZSTM[R, E, D])(f: (A, B, C, D) ⇒ F): ZSTM[R, E, F]
Sequentially zips the specified effects using the specified combiner function.
Sequentially zips the specified effects using the specified combiner function.
- Annotations
- @deprecated
- Deprecated
(Since version 2.0.0) use zip
-
def
mapN[R, E, A, B, C, D](tx1: ZSTM[R, E, A], tx2: ZSTM[R, E, B], tx3: ZSTM[R, E, C])(f: (A, B, C) ⇒ D): ZSTM[R, E, D]
Sequentially zips the specified effects using the specified combiner function.
Sequentially zips the specified effects using the specified combiner function.
- Annotations
- @deprecated
- Deprecated
(Since version 2.0.0) use zip
-
def
mapN[R, E, A, B, C](tx1: ZSTM[R, E, A], tx2: ZSTM[R, E, B])(f: (A, B) ⇒ C): ZSTM[R, E, C]
Sequentially zips the specified effects using the specified combiner function.
Sequentially zips the specified effects using the specified combiner function.
- Annotations
- @deprecated
- Deprecated
(Since version 2.0.0) use zip
-
def
partial[A](a: ⇒ A): STM[Throwable, A]
Creates an
STMvalue from a partial (but pure) function.Creates an
STMvalue from a partial (but pure) function.- Annotations
- @deprecated
- Deprecated
(Since version 2.0.0) use attempt
-
def
replicateM[R, E, A](n: Int)(transaction: ZSTM[R, E, A]): ZSTM[R, E, Iterable[A]]
Performs this transaction the specified number of times and collects the results.
Performs this transaction the specified number of times and collects the results.
- Annotations
- @deprecated
- Deprecated
(Since version 2.0.0) use replicateSTM
-
def
replicateM_[R, E, A](n: Int)(transaction: ZSTM[R, E, A]): ZSTM[R, E, Unit]
Performs this transaction the specified number of times, discarding the results.
Performs this transaction the specified number of times, discarding the results.
- Annotations
- @deprecated
- Deprecated
(Since version 2.0.0) use replicateSTMDiscard
-
def
require[R, E, A](error: ⇒ E): (ZSTM[R, E, Option[A]]) ⇒ ZSTM[R, E, A]
Requires that the given
ZSTM[R, E, Option[A]]contain a value.Requires that the given
ZSTM[R, E, Option[A]]contain a value. If there is no value, then the specified error will be raised.- Annotations
- @deprecated
- Deprecated
(Since version 2.0.0) use someOrFail
-
def
services[A, B, C, D](implicit arg0: zio.Tag[A], arg1: zio.Tag[B], arg2: zio.Tag[C], arg3: zio.Tag[D]): ZSTM[Has[A] with Has[B] with Has[C] with Has[D], Nothing, (A, B, C, D)]
Accesses the specified services in the environment of the effect.
Accesses the specified services in the environment of the effect.
- Annotations
- @deprecated
- Deprecated
(Since version 2.0.0) use service
-
def
services[A, B, C](implicit arg0: zio.Tag[A], arg1: zio.Tag[B], arg2: zio.Tag[C]): ZSTM[Has[A] with Has[B] with Has[C], Nothing, (A, B, C)]
Accesses the specified services in the environment of the effect.
Accesses the specified services in the environment of the effect.
- Annotations
- @deprecated
- Deprecated
(Since version 2.0.0) use service
-
def
services[A, B](implicit arg0: zio.Tag[A], arg1: zio.Tag[B]): ZSTM[Has[A] with Has[B], Nothing, (A, B)]
Accesses the specified services in the environment of the effect.
Accesses the specified services in the environment of the effect.
- Annotations
- @deprecated
- Deprecated
(Since version 2.0.0) use service
-
def
unlessM[R, E](b: ZSTM[R, E, Boolean]): UnlessSTM[R, E]
The moral equivalent of
if (!p) expwhenphas side-effectsThe moral equivalent of
if (!p) expwhenphas side-effects- Annotations
- @deprecated
- Deprecated
(Since version 2.0.0) use unlessSTM
-
def
whenCaseM[R, E, A, B](a: ZSTM[R, E, A])(pf: PartialFunction[A, ZSTM[R, E, B]]): ZSTM[R, E, Option[B]]
Runs an effect when the supplied
PartialFunctionmatches for the given effectful value, otherwise does nothing.Runs an effect when the supplied
PartialFunctionmatches for the given effectful value, otherwise does nothing.- Annotations
- @deprecated
- Deprecated
(Since version 2.0.0) use whenCaseSTM
-
def
whenM[R, E](b: ZSTM[R, E, Boolean]): WhenSTM[R, E]
The moral equivalent of
if (p) expwhenphas side-effectsThe moral equivalent of
if (p) expwhenphas side-effects- Annotations
- @deprecated
- Deprecated
(Since version 2.0.0) use whenSTM