Packages

object Do

The companion object of Do

Source
asynchronous.scala
Linear Supertypes
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
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. def apply[A](tryT: TryT[[+β$1$]ResourceT[[+A]Continuation[Unit, A], β$1$], A]): Do[A]
  5. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  6. def async[A](start: ((Resource[UnitContinuation, Try[A]]) ⇒ Unit) ⇒ Unit): Do[A]
  7. def autoCloseable[A <: AutoCloseable](value: ⇒ A): Do[A]

    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, A 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[A <: AutoCloseable](continuation: UnitContinuation[A], dummyImplicit: DummyImplicit = DummyImplicit.dummyImplicit): Do[A]

    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, A will be recreated each time it is sequenced into a larger Do.

    See also

    monadicCloseable 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[A <: AutoCloseable](future: Future[A]): Do[A]

    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, A will be recreated each time it is sequenced into a larger Do.

    See also

    monadicCloseable 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
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @native() @throws( ... )
  11. def delay[A](value: ⇒ A): Do[A]

    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, A will be recreated each time it is sequenced into a larger Do.

    A 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
    Definition Classes
    AnyRef
  13. def equals(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  14. def execute[A](value: ⇒ A)(implicit executorContext: ExecutionContext): Do[A]

    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, A 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
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  16. def garbageCollected[A](contT: ContT[Trampoline, Unit, A]): Do[A]

    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, A will be recreated each time it is sequenced into a larger Do.

    A 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[A](continuation: UnitContinuation[A], dummyImplicit: DummyImplicit = DummyImplicit.dummyImplicit): Do[A]

    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, A will be recreated each time it is sequenced into a larger Do.

    A 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[A](future: Future[A]): Do[A]

    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, A will be recreated each time it is sequenced into a larger Do.

    A 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[_]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  20. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  21. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  22. def monadicCloseable[A <: MonadicCloseable[UnitContinuation]](value: ⇒ A): Do[A]

    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, A 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[A <: MonadicCloseable[UnitContinuation]](future: UnitContinuation[A], dummyImplicit: DummyImplicit = DummyImplicit.dummyImplicit): Do[A]

    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, A 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[A <: MonadicCloseable[UnitContinuation]](future: Future[A]): Do[A]

    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, A 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
    Definition Classes
    AnyRef
  26. def nested[A](doA: Do[A]): Do[A]

    Returns a nested scope of doA.

    Returns a nested scope of doA.

    All resources created during building A will be released after A is built.

    Note

    This method has the same behavior as Do.garbageCollected(doA.run).

    ,

    A must be a garbage collected type, i.e. not a java.lang.AutoCloseable or a com.thoughtworks.raii.covariant.MonadicCloseable

    See also

    AsynchronousDoOps.run for running a Do as a ThoughtWorks Future.

    garbageCollected for creating a garbage collected Do

  27. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  28. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  29. def now[A](value: A): Do[A]

    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.

    A 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

  30. def resource[A](resource: ⇒ Resource[UnitContinuation, A]): Do[A]
  31. def safeAsync[A](start: ((Resource[UnitContinuation, Try[A]]) ⇒ Trampoline[Unit]) ⇒ Trampoline[Unit]): Do[A]
  32. def suspend[A](doValue: ⇒ Do[A]): Do[A]
  33. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  34. def toString(): String
    Definition Classes
    AnyRef → Any
  35. def unapply[A](doValue: Do[A]): Some[TryT[[+β$2$]ResourceT[[+A]Continuation[Unit, A], β$2$], A]]
  36. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  37. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  38. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @throws( ... )

Deprecated Value Members

  1. def scoped[A <: AutoCloseable](value: ⇒ A): Do[A]
    Annotations
    @deprecated
    Deprecated

    (Since version 3.0.0) Use autoCloseable instead.

  2. def scoped[A <: AutoCloseable](contT: ContT[Trampoline, Unit, A]): Do[A]
    Annotations
    @deprecated
    Deprecated

    (Since version 3.0.0) Use autoCloseable instead.

  3. def scoped[A <: AutoCloseable](future: UnitContinuation[A], dummyImplicit: DummyImplicit = DummyImplicit.dummyImplicit): Do[A]
    Annotations
    @deprecated
    Deprecated

    (Since version 3.0.0) Use autoCloseable instead.

  4. def scoped[A <: AutoCloseable](future: Future[A]): Do[A]
    Annotations
    @deprecated
    Deprecated

    (Since version 3.0.0) Use autoCloseable instead.

Inherited from AnyRef

Inherited from Any

Ungrouped