trait _Trait extends AnyRef

EventControl allows to cancel the event job directly or conditionally

val timer: Pro.O[Time] = Time.currentPro(1.Second)                   // Value changes every 1 second

val ec1: EventControl = timer.onValueChange("1: " + _.subSeconds lp) // Prints seconds within minute
val ec2: EventControl = timer.onValueChange("2: " + _.subSeconds lp) // Prints seconds within minute
val ec3: EventControl = timer.onValueChange("3: " + _.subSeconds lp) // Prints seconds within minute

ec1.limitRunsTo(2)
ec2.cancelIfTrue(ec1.isCancelled)
ec2.onCancelRun(ec3.cancel)

// Output
3: 20 secs
2: 20 secs
1: 20 secs
3: 21 secs
2: 21 secs
1: 21 secs
3: 22 secs
2: 22 secs
3: 23 secs
Ordering
  1. Alphabetic
Inherited
  1. EventControl
  2. scala.AnyRef
  3. scala.Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Method

  1. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  2. abstract def cancel: Boolean

    Cancel

    Cancel

    Cancels the controlled job, so it will never execute again

    Returns 'true' if the job was cancelled, 'false' if it was already cancelled

    Definition Classes
    _Trait
  3. abstract def cancelIf(b: () ⇒ Boolean): EventControl

    Conditional cancel

    Conditional cancel

    The given function will be checked before each controlled job execution and if positive, the job will be canceled

    Returns this

    Definition Classes
    _Trait
  4. def cancelIfFalse(b: ⇒ Boolean): EventControl

    Reverse conditional cancel

    Reverse conditional cancel

    The given function will be checked before each controlled job execution and if negative, the job will be canceled

    Definition Classes
    _Trait
  5. def cancelIfTrue(b: ⇒ Boolean): EventControl

    Conditional cancel

    Conditional cancel

    The given implied function will be checked before each controlled job execution and if positive, the job will be canceled

    Returns this *

    Definition Classes
    _Trait
  6. def clone(): AnyRef
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  7. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  8. def equals(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  9. def expireIn(tl: Duration): EventControl

    Timed cancel

    Timed cancel

    The time will be checked before each controlled job execution and if expired, the job will be canceled

    Definition Classes
    _Trait
  10. def finalize(): Unit
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  11. def hashCode(): Int
    Definition Classes
    AnyRef → Any
  12. abstract def isCancelled: Boolean

    Canceled check

    Canceled check

    Returns 'true' if the controlled job is cancelled

    Definition Classes
    _Trait
  13. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  14. def limitRunsTo(maxRunCount: Int): EventControl

    Counter cancel

    Counter cancel

    Each controlled job execution will be counted, and if maxRunCount exceeded, the job will be canceled

    Definition Classes
    _Trait
  15. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  16. final def notify(): Unit
    Definition Classes
    AnyRef
  17. final def notifyAll(): Unit
    Definition Classes
    AnyRef
  18. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  19. def toString(): String
    Definition Classes
    AnyRef → Any
  20. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  21. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  22. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Operator

  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

Event

  1. abstract def onCancel(b: () ⇒ Any): EventControl

    On cancelled event

    On cancelled event

    Executes given function when the job is cancelled

    Returns this

    Definition Classes
    _Trait
  2. def onCancelRun(f: ⇒ Any): EventControl

    Run on cancel

    Run on cancel

    Executes given implied function when the job is cancelled

    Returns this

    Definition Classes
    _Trait
Linear Supertypes
AnyRef, Any
Known Subclasses
Source: _Trait.scala