listener-callback   scheme


Defined in:  https://github.com/digego/extempore/tree/v0.8.9/examples/contrib/nanomsg.xtm

Implementation

(define listener-callback
  (lambda (time delta-t)
    (let ((res (cptr->string (listener))))
      (if (not (string=? res ""))
          (println 'listener 'received: res)))
    (let ((next-time (max (+ time (* *second* delta-t)) (now))))
      (callback next-time
                'listener-callback
                next-time
                delta-t))))


Back to Index