Created
July 27, 2012 06:31
-
-
Save yamasushi/3186464 to your computer and use it in GitHub Desktop.
call-with-input-httpを「ポートの反転」で書く。
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
; http-getのパラメタ指定してhttp-get、procに仮想ポートを渡す。 | |
(define (call-with-input-http http-param proc :key (queue-size 100) (buffer-size 8000) ) | |
(let1 inverter (mtport-inverter :queue-size queue-size :buffer-size buffer-size) | |
(inverter | |
(^[outp] (apply http-get (append http-param `(:sink ,outp :flusher ,(^ _ (flush outp) #t) )))) | |
(^[inp] (proc inp) ) ) ) ) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment