object SyncIO extends SyncIOCompanionPlatform with SyncIOLowPriorityImplicits with Serializable
- Source
- SyncIO.scala
- Alphabetic
- By Inheritance
- SyncIO
- Serializable
- SyncIOLowPriorityImplicits
- SyncIOCompanionPlatform
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Type Members
- class SyncIOSemigroup[A] extends kernel.Semigroup[SyncIO[A]]
- Attributes
- protected
- Definition Classes
- SyncIOLowPriorityImplicits
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
- implicit def alignForSyncIO: Align[SyncIO]
- def apply[A](thunk: => A): SyncIO[A]
Suspends a synchronous side effect in
SyncIO
.Suspends a synchronous side effect in
SyncIO
.Any exceptions thrown by the effect will be caught and sequenced into the
SyncIO
.- thunk
side effectful expression to be suspended in
SyncIO
- returns
a
SyncIO
that will be evaluated to the side effectful expressionthunk
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native()
- def defer[A](thunk: => SyncIO[A]): SyncIO[A]
Suspends a synchronous side effect which produces a
SyncIO
inSyncIO
.Suspends a synchronous side effect which produces a
SyncIO
inSyncIO
.This is useful for trampolining (i.e. when the side effect is conceptually the allocation of a stack frame). Any exceptions thrown by the side effect will be caught and sequenced into the
SyncIO
.- thunk
SyncIO
expression to be suspended inSyncIO
- returns
a
SyncIO
that will be evaluated to the value of the suspendedthunk
- def delay[A](thunk: => A): SyncIO[A]
Alias for
apply
.Alias for
apply
.- See also
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- def eval[A](fa: Eval[A]): SyncIO[A]
Lifts an
Eval
intoSyncIO
.Lifts an
Eval
intoSyncIO
.This function will preserve the evaluation semantics of any actions that are lifted into the pure
SyncIO
. EagerEval
instances will be converted into thunk-lessSyncIO
(i.e. eagerSyncIO
), while lazy eval and memoized will be executed as such.- fa
Eval
instance to be lifted inSyncIO
- returns
SyncIO
that will be evaluated to the value of the liftedfa
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable])
- def fromEither[A](e: Either[Throwable, A]): SyncIO[A]
Lifts an
Either[Throwable, A]
intoSyncIO
, raising the throwable if it exists.Lifts an
Either[Throwable, A]
intoSyncIO
, raising the throwable if it exists.- e
either value to be lifted
- returns
SyncIO
that evaluates to the value ofe
or fail with itsThrowable
instance
- def fromOption[A](o: Option[A])(orElse: => Throwable): SyncIO[A]
Lifts an
Option[A]
intoSyncIO
, raisingorElse
if the provided option value is empty.Lifts an
Option[A]
intoSyncIO
, raisingorElse
if the provided option value is empty.- o
option value to be lifted
- orElse
expression that evaluates to
Throwable
- returns
SyncIO
that evaluates to the optional valueo
or fail with theorElse
expression
- def fromTry[A](t: Try[A]): SyncIO[A]
Lifts a
Try[A]
intoSyncIO
, raising the throwable if it exists.Lifts a
Try[A]
intoSyncIO
, raising the throwable if it exists.- t
try value to be lifted
- returns
SyncIO
that evaluates to the value oft
if successful, or fails with itsThrowable
instance
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- implicit def monoidForIO[A](implicit arg0: kernel.Monoid[A]): kernel.Monoid[SyncIO[A]]
- val monotonic: SyncIO[FiniteDuration]
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- def pure[A](value: A): SyncIO[A]
Suspends a pure value in
SyncIO
.Suspends a pure value in
SyncIO
.This should only be used if the value in question has "already" been computed! In other words, something like
SyncIO.pure(readLine)
is most definitely not the right thing to do! However,SyncIO.pure(42)
is correct and will be more efficient (when evaluated) thanSyncIO(42)
, due to avoiding the allocation of extra thunks.- value
precomputed value used as the result of the
SyncIO
- returns
an already evaluated
SyncIO
holdingvalue
- def raiseError[A](t: Throwable): SyncIO[A]
Constructs a
SyncIO
which sequences the specified exception.Constructs a
SyncIO
which sequences the specified exception.If this
SyncIO
is run usingunsafeRunSync
the exception will be thrown. This exception can be "caught" (or rather, materialized into value-space) using theattempt
method.- t
Throwable
value to fail with- returns
a
SyncIO
that results in failure with valuet
- See also
- val realTime: SyncIO[FiniteDuration]
- final def realTimeInstant: SyncIO[Instant]
- Definition Classes
- SyncIOCompanionPlatform
- implicit def semigroupForIO[A](implicit arg0: kernel.Semigroup[A]): kernel.Semigroup[SyncIO[A]]
- Definition Classes
- SyncIOLowPriorityImplicits
- implicit def showForSyncIO[A](implicit A: Show[A]): Show[SyncIO[A]]
- implicit def syncForSyncIO: Sync[SyncIO] with MonadCancel[SyncIO, Throwable]
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toString(): String
- Definition Classes
- AnyRef → Any
- def unit: SyncIO[Unit]
Alias for
SyncIO.pure(())
Alias for
SyncIO.pure(())
- See also
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()