File: heartbeat.l

package info (click to toggle)
picolisp 3.1.0.7-1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 4,100 kB
  • sloc: ansic: 14,205; lisp: 795; makefile: 290; sh: 13
file content (19 lines) | stat: -rw-r--r-- 424 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# 16feb08abu
# (c) Software Lab. Alexander Burger

(ifn (info "fifo/beat")
   (de heartbeat ())

   (de heartbeat @
      (out "fifo/beat"
         (pr
            (cons *Pid
               (cons
                  (+ (* 86400 (date T)) (time T) 300)  # Busy period 5 minutes
                  (rest) ) ) ) ) )

   (task -54321 0 (heartbeat))
   (push1 '*Bye '(out "fifo/beat" (pr *Pid))) )

(de nobeat ()
   (task -54321) )