All Downloads are FREE. Search and download functionalities are using the official Maven repository.

libretto.timer.TimerDSL.scala Maven / Gradle / Ivy

The newest version!
package libretto.timer

import libretto.puro.{Puro, PuroLib}
import scala.concurrent.duration.FiniteDuration

trait TimerDSL extends Puro {
  def delay(d: FiniteDuration): Done -⚬ Done

  private val lib = PuroLib(this)
  import lib.*

  def delayNeed(d: FiniteDuration): Need -⚬ Need = {
    id                                [                      Need  ]
      ./>(introFst(lInvertSignal)) .to[ (Need |*|  Done) |*| Need  ]
      ./>.fst.snd(delay(d))        .to[ (Need |*|  Done) |*| Need  ]
      ./>(assocLR)                 .to[  Need |*| (Done  |*| Need) ]
      ./>(elimSnd(rInvertSignal))  .to[  Need                      ]
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy