From ad9a78b4a4f89bb1f7cc4639bf767704c7a656c2 Mon Sep 17 00:00:00 2001 From: Tony Garnock-Jones Date: Sat, 16 Jan 2016 22:12:35 -0500 Subject: [PATCH] Directly detect incoming connections in examples/chat-simplified-internals --- prospect/examples/chat-simplified-internals.rkt | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/prospect/examples/chat-simplified-internals.rkt b/prospect/examples/chat-simplified-internals.rkt index b356fcb..1320030 100644 --- a/prospect/examples/chat-simplified-internals.rkt +++ b/prospect/examples/chat-simplified-internals.rkt @@ -70,6 +70,13 @@ (observe (tcp-channel (?!) (?! (tcp-listener 5999)) ?)) tcp-proxy-process) -(spawn-demand-matcher (tcp-remote-open (?!)) - (tcp-local-open (?!)) - spawn-session) +(spawn (lambda (e s) + (if (patch? e) + (transition s + (for/list [(id (matcher-project/set/single + (patch-added e) + (compile-projection (tcp-remote-open (?!)))))] + (spawn-session id))) + #f)) + (void) + (sub (tcp-remote-open ?)))