Skip to content
This repository was archived by the owner on Oct 26, 2023. It is now read-only.

Commit be0b883

Browse files
committed
cleanup
Threading code is now more consistent with overall style of project.
1 parent 39d32bd commit be0b883

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

main.rkt

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
(require json
33
mzlib/cml
44
racket/exn
5+
racket/function
6+
racket/list
57
racket/match
68
"append-message.rkt"
79
"error-codes.rkt"
@@ -17,7 +19,7 @@
1719
(define in-ch (channel))
1820
(define out-ch (channel))
1921
(define (serve msgs)
20-
(cond [(null? msgs)
22+
(cond [(empty? msgs)
2123
(serve (list (sync (channel-recv-evt in-ch))))]
2224
[else
2325
(sync (choice-evt
@@ -26,10 +28,10 @@
2628
(λ (m)
2729
(serve (append-message msgs m))))
2830
(wrap-evt
29-
(channel-send-evt out-ch (car msgs))
30-
(λ (void)
31-
(serve (cdr msgs))))))]))
32-
(define mgr-t (spawn (λ () (serve (list)))))
31+
(channel-send-evt out-ch (first msgs))
32+
(thunk*
33+
(serve (rest msgs))))))]))
34+
(define mgr-t (spawn (λ () (serve empty))))
3335
(Q in-ch out-ch mgr-t))
3436

3537
(define (queue-send-evt q v)

0 commit comments

Comments
 (0)