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._ implicit def executorContext = ExecutionContext.fromExecutor(Executors.newSingleThreadExecutor()) val mainThread = Thread.currentThread Do.run { for { _ <- Do.delay(()) threadBeforeJump = Thread.currentThread _ = threadBeforeJump should be(mainThread) _ <- Do.execute(()) threadAfterJump = Thread.currentThread } yield { threadAfterJump shouldNot be(mainThread) } }
Returns a non-strict Do
whose release operation is no-op.
Since the Do
is non-strict,
Value
will be recreated each time it is sequenced into a larger Do
.
scoped for auto-closeable Do
now for strict garbage collected Do
Returns a non-strict Do
whose release operation is no-op.
Returns a non-strict Do
whose release operation is no-op.
Since the Do
is non-strict,
Value
will be recreated each time it is sequenced into a larger Do
.
Value
must be a garbage-collected type that does not hold native resource.
Returns a non-strict Do
whose release operation is no-op.
Returns a non-strict Do
whose release operation is no-op.
Since the Do
is non-strict,
Value
will be recreated each time it is sequenced into a larger Do
.
Value
must be a garbage-collected type that does not hold native resource.
Returns a non-strict Do
whose release operation is no-op.
Returns a non-strict Do
whose release operation is no-op.
Since the Do
is non-strict,
Value
will be recreated each time it is sequenced into a larger Do
.
Value
must be a garbage-collected type that does not hold native resource.
Returns a Do
of B
based on a Do
of Value
and a function that creates a Do
of B
,
for those B
do not reference to A
or A
is a garbage collected object.
Returns a Do
of B
based on a Do
of Value
and a function that creates a Do
of B
,
for those B
do not reference to A
or A
is a garbage collected object.
intransitiveFlatMap
is similar to flatMap
in doMonadErrorInstances,
except intransitiveFlatMap
will release Value
right after B
is created.
Don't use this method if you need to retain A
until B
is released.
Returns a Do
of B
based on a Do
of Value
and a function that creates B
,
for those B
do not reference to A
or A
is a garbage collected object.
Returns a Do
of B
based on a Do
of Value
and a function that creates B
,
for those B
do not reference to A
or A
is a garbage collected object.
intransitiveMap
is similar to map
in doMonadErrorInstances,
except intransitiveMap
will release Value
right after B
is created.
Don't use this method if you need to retain A
until B
is released.
Converts a strict value to a Do
whose release operation is no-op.
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.
The companion object of Do