Update fetchurl.rkt for prospect-monolithic.
This commit is contained in:
parent
594add5939
commit
265eee348a
28
fetchurl.rkt
28
fetchurl.rkt
|
@ -27,21 +27,23 @@
|
||||||
|
|
||||||
(spawn (lambda (e seen-peer?)
|
(spawn (lambda (e seen-peer?)
|
||||||
(match e
|
(match e
|
||||||
[(routing-update g)
|
[(scn g)
|
||||||
(define peer-present? (not (gestalt-empty? g)))
|
(define peer-present? (trie-non-empty? g))
|
||||||
(transition (or seen-peer? peer-present?)
|
(if (and (not peer-present?) seen-peer?)
|
||||||
(if (and (not peer-present?) seen-peer?)
|
(begin (printf "URL fetcher exiting.\n")
|
||||||
(quit)
|
(quit))
|
||||||
(send (tcp-channel
|
(transition (or seen-peer? peer-present?)
|
||||||
local-handle
|
(message
|
||||||
remote-handle
|
(tcp-channel
|
||||||
#"GET / HTTP/1.0\r\nHost: stockholm.ccs.neu.edu\r\n\r\n"))))]
|
local-handle
|
||||||
[(message (tcp-channel _ _ bs) _ _)
|
remote-handle
|
||||||
|
#"GET / HTTP/1.0\r\nHost: stockholm.ccs.neu.edu\r\n\r\n"))))]
|
||||||
|
[(message (tcp-channel _ _ bs))
|
||||||
(printf "----------------------------------------\n~a\n" bs)
|
(printf "----------------------------------------\n~a\n" bs)
|
||||||
(printf "----------------------------------------\n")
|
(printf "----------------------------------------\n")
|
||||||
#f]
|
#f]
|
||||||
[_ #f]))
|
[_ #f]))
|
||||||
#f
|
#f
|
||||||
(gestalt-union (pub (tcp-channel local-handle remote-handle ?))
|
(scn/union (advertisement (tcp-channel local-handle remote-handle ?))
|
||||||
(sub (tcp-channel remote-handle local-handle ?))
|
(subscription (tcp-channel remote-handle local-handle ?))
|
||||||
(sub (tcp-channel remote-handle local-handle ?) #:level 1))))
|
(subscription (advertise (tcp-channel remote-handle local-handle ?))))))
|
||||||
|
|
Loading…
Reference in New Issue