Packages

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
    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[Value](tryT: TryT[[+β$1$]ResourceT[[+A]Continuation[Unit, A], β$1$], Value]): Do[Value]
  5. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  6. def clone(): AnyRef
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  7. def delay[Value](value: ⇒ Value): Do[Value]

    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

    scoped for auto-closeable Do

    now for strict garbage collected Do

  8. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  9. def equals(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  10. def execute[Value](value: ⇒ Value)(implicit executorContext: ExecutionContext): Do[Value]

    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

    scoped for auto-closeable Do

    now for strict garbage collected Do

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

    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

    scoped for auto-closeable Do

    now for strict garbage collected Do

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

    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

    scoped for auto-closeable Do

    now for strict garbage collected Do

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

    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

    scoped for auto-closeable Do

    now for strict garbage collected Do

  15. final def getClass(): Class[_]
    Definition Classes
    AnyRef → Any
  16. def hashCode(): Int
    Definition Classes
    AnyRef → Any
  17. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  18. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  19. final def notify(): Unit
    Definition Classes
    AnyRef
  20. final def notifyAll(): Unit
    Definition Classes
    AnyRef
  21. def now[Value](value: Value): Do[Value]

    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

    scoped for auto-closeable Do

    delay for non-strict garbage collected Do

  22. def scoped[Value <: AutoCloseable](value: ⇒ Value): Do[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.

    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

  23. def scoped[Value <: AutoCloseable](continuation: ContT[Trampoline, Unit, Value]): Do[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.

    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

  24. def scoped[Value <: AutoCloseable](future: UnitContinuation[Value], dummyImplicit: DummyImplicit = DummyImplicit.dummyImplicit): Do[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.

    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

  25. def scoped[Value <: AutoCloseable](future: Future[Value]): Do[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.

    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

  26. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  27. def toString(): String
    Definition Classes
    AnyRef → Any
  28. def unapply[Value](doValue: Do[Value]): Some[TryT[[+β$2$]ResourceT[[+A]Continuation[Unit, A], β$2$], Value]]
  29. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  30. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  31. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from AnyRef

Inherited from Any

Ungrouped