picolisp

Unnamed repository; edit this file to name it for gitweb.
git clone https://logand.com/git/picolisp.git/
Log | Files | Refs | README | LICENSE

heartbeat.l (424B)


      1 # 16feb08abu
      2 # (c) Software Lab. Alexander Burger
      3 
      4 (ifn (info "fifo/beat")
      5    (de heartbeat ())
      6 
      7    (de heartbeat @
      8       (out "fifo/beat"
      9          (pr
     10             (cons *Pid
     11                (cons
     12                   (+ (* 86400 (date T)) (time T) 300)  # Busy period 5 minutes
     13                   (rest) ) ) ) ) )
     14 
     15    (task -54321 0 (heartbeat))
     16    (push1 '*Bye '(out "fifo/beat" (pr *Pid))) )
     17 
     18 (de nobeat ()
     19    (task -54321) )