Returns a non-strict Do
whose release operation is no-op.
Returns a non-strict Do
whose release operation is no-op.
Returns a non-strict Do
whose release operation is no-op.
Returns a non-strict Do
whose release operation is no-op.
Returns a Do
that runs in executorContext
Returns a Do
that runs in executorContext
This method is usually been used for changing the current thread.
import java.util.concurrent._ import scala.concurrent._ import scalaz.syntax.all._ import com.thoughtworks.raii.asynchronous.Do, Do._ implicit def executorContext = ExecutionContext.fromExecutor(Executors.newSingleThreadExecutor()) val mainThread = Thread.currentThread Do.run { for { _ <- Do.delay(()) threadBeforeJump = Thread.currentThread _ = threadBeforeJump should be(mainThread) _ <- Do.jump() threadAfterJump = Thread.currentThread } yield { threadAfterJump shouldNot be(mainThread) } }
Converts a strict value to a Do
whose release operation is no-op.
Returns a Do
of B
based on a Do
of Value
and a function that creates a Do
of B
.
Returns a Do
of B
based on a Do
of Value
and a function that creates a Do
of B
.
releaseFlatMap
is similar to flatMap
in doMonadErrorInstances,
except releaseFlatMap
will release Value
right after B
is created.
Returns a Do
of B
based on a Do
of Value
and a function that creates B
.
Returns a Do
of B
based on a Do
of Value
and a function that creates B
.
releaseMap
is similar to map
in doMonadErrorInstances,
except releaseMap
will release Value
right after B
is created.
Returns a Future
of Value
, which will open Value
and release all resources during opening Value
.
Returns a non-strict Do
whose release operation is java.lang.AutoCloseable.close.
Returns a non-strict Do
whose release operation is java.lang.AutoCloseable.close.
Returns a non-strict Do
whose release operation is java.lang.AutoCloseable.close.
Returns a non-strict Do
whose release operation is java.lang.AutoCloseable.close.
Converts doValue
to a reference counted wrapper Do
.
Returns the underlying com.thoughtworks.future.continuation.UnitContinuation that creates a covariant.Releasable Value
.
The companion object of Do