PasteRack.org
Paste # 44913
2018-11-09 12:01:06

Fork as a new paste.

Paste viewed 2460 times.


Embed:

  1. #lang racket
  2.  
  3. (define ((get-current-visitors cv) req)
  4.   (response/output
  5.    (lambda (out)
  6.      (current-visitors-subscribe cv (current-thread))
  7.      (let loop ()
  8.        (write-bytes (string->bytes/utf-8 (number->string (thread-receive))) out)
  9.        (flush-output out)
  10.        (unless (port-closed? out)
  11.          (loop))))))

=>