Object

com.thoughtworks.raii.asynchronous

Do

Related Doc: package asynchronous

Permalink

object Do

The companion object of Do

Source
asynchronous.scala
Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Do
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  4. def apply[Value](tryT: TryT[[+β$1$]ResourceT[[+A]Continuation[Unit, A], β$1$], Value]): Do[Value]

    Permalink
  5. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  6. def async[Value](start: ((Resource[UnitContinuation, Try[Value]]) ⇒ Unit) ⇒ Unit): Do[Value]

    Permalink
  7. def autoCloseable[Value <: AutoCloseable](value: ⇒ Value): Do[Value]

    Permalink

    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.

    Since the Do is non-strict, Value will be recreated each time it is sequenced into a larger Do.

    See also

    delay for non-strict garbage collected Do

    now for strict garbage collected Do

  8. def autoCloseable[Value <: AutoCloseable](future: UnitContinuation[Value], dummyImplicit: DummyImplicit = DummyImplicit.dummyImplicit): Do[Value]

    Permalink

    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.

    Since the Do is non-strict, Value will be recreated each time it is sequenced into a larger Do.

    See also

    releasable for creating a Do whose release operation is asynchronous.

    delay for non-strict garbage collected Do

    now for strict garbage collected Do

  9. def autoCloseable[Value <: AutoCloseable](future: Future[Value]): Do[Value]

    Permalink

    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.

    Since the Do is non-strict, Value will be recreated each time it is sequenced into a larger Do.

    See also

    releasable for creating a Do whose release operation is asynchronous.

    delay for non-strict garbage collected Do

    now for strict garbage collected Do

  10. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  11. def delay[Value](value: ⇒ Value): Do[Value]

    Permalink

    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.

    See also

    autoCloseable for auto-closeable Do

    now for strict garbage collected Do

  12. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  13. def equals(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  14. def execute[Value](value: ⇒ Value)(implicit executorContext: ExecutionContext): Do[Value]

    Permalink

    Returns a Do that runs in executorContext.

    Returns a Do that runs in executorContext.

    Note

    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
    val doAssertion = for {
      _ <- Do.delay(())
      threadBeforeJump = Thread.currentThread
      _ = threadBeforeJump should be(mainThread)
      _ <- Do.execute(())
      threadAfterJump = Thread.currentThread
    } yield {
      threadAfterJump shouldNot be(mainThread)
    }
    doAssertion.run

    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.

    See also

    autoCloseable for auto-closeable Do

    now for strict garbage collected Do

  15. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  16. def garbageCollected[Value](contT: ContT[Trampoline, Unit, Value]): Do[Value]

    Permalink

    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.

    See also

    delay for non-strict garbage collected Do

    autoCloseable for auto-closeable Do

    now for strict garbage collected Do

  17. def garbageCollected[Value](continuation: UnitContinuation[Value], dummyImplicit: DummyImplicit = DummyImplicit.dummyImplicit): Do[Value]

    Permalink

    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.

    See also

    delay for non-strict garbage collected Do

    autoCloseable for auto-closeable Do

    now for strict garbage collected Do

  18. def garbageCollected[Value](future: Future[Value]): Do[Value]

    Permalink

    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.

    See also

    delay for non-strict garbage collected Do

    autoCloseable for auto-closeable Do

    now for strict garbage collected Do

  19. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  20. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  21. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  22. def monadicCloseable[Value <: MonadicCloseable[UnitContinuation]](value: ⇒ Value): Do[Value]

    Permalink

    Returns a non-strict Do whose release operation is asynchronous.

    Returns a non-strict Do whose release operation is asynchronous.

    Since the Do is non-strict, Value will be recreated each time it is sequenced into a larger Do.

    See also

    autoCloseable for auto-closeable Do

    delay for non-strict garbage collected Do

    now for strict garbage collected Do

  23. def monadicCloseable[Value <: MonadicCloseable[UnitContinuation]](future: UnitContinuation[Value], dummyImplicit: DummyImplicit = DummyImplicit.dummyImplicit): Do[Value]

    Permalink

    Returns a non-strict Do whose release operation is asynchronous.

    Returns a non-strict Do whose release operation is asynchronous.

    Since the Do is non-strict, Value will be recreated each time it is sequenced into a larger Do.

    See also

    autoCloseable for auto-closeable Do

    delay for non-strict garbage collected Do

    now for strict garbage collected Do

  24. def monadicCloseable[Value <: MonadicCloseable[UnitContinuation]](future: Future[Value]): Do[Value]

    Permalink

    Returns a non-strict Do whose release operation is asynchronous.

    Returns a non-strict Do whose release operation is asynchronous.

    Since the Do is non-strict, Value will be recreated each time it is sequenced into a larger Do.

    See also

    autoCloseable for auto-closeable Do

    delay for non-strict garbage collected Do

    now for strict garbage collected Do

  25. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  26. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  27. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  28. def now[Value](value: Value): Do[Value]

    Permalink

    Converts a strict value to a Do whose release operation is no-op.

    Converts a strict value to a Do whose release operation is no-op.

    Value must be a garbage-collected type that does not hold native resource.

    See also

    autoCloseable for auto-closeable Do

    delay for non-strict garbage collected Do

  29. def safeAsync[Value](start: ((Resource[UnitContinuation, Try[Value]]) ⇒ Trampoline[Unit]) ⇒ Trampoline[Unit]): Do[Value]

    Permalink
  30. def suspend[Value](doValue: ⇒ Do[Value]): Do[Value]

    Permalink
  31. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  32. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  33. def unapply[Value](doValue: Do[Value]): Some[TryT[[+β$2$]ResourceT[[+A]Continuation[Unit, A], β$2$], Value]]

    Permalink
  34. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  35. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  36. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Deprecated Value Members

  1. def scoped[Value <: AutoCloseable](value: ⇒ Value): Do[Value]

    Permalink
    Annotations
    @deprecated
    Deprecated

    (Since version 3.0.0) Use autoCloseable instead.

  2. def scoped[Value <: AutoCloseable](contT: ContT[Trampoline, Unit, Value]): Do[Value]

    Permalink
    Annotations
    @deprecated
    Deprecated

    (Since version 3.0.0) Use autoCloseable instead.

  3. def scoped[Value <: AutoCloseable](future: UnitContinuation[Value], dummyImplicit: DummyImplicit = DummyImplicit.dummyImplicit): Do[Value]

    Permalink
    Annotations
    @deprecated
    Deprecated

    (Since version 3.0.0) Use autoCloseable instead.

  4. def scoped[Value <: AutoCloseable](future: Future[Value]): Do[Value]

    Permalink
    Annotations
    @deprecated
    Deprecated

    (Since version 3.0.0) Use autoCloseable instead.

Inherited from AnyRef

Inherited from Any

Ungrouped