Switch from co-role -> co-roles
This commit is contained in:
parent
ffe06a65a8
commit
ea2ff20dc6
|
@ -24,7 +24,7 @@
|
|||
(struct-out topic)
|
||||
topic-publisher
|
||||
topic-subscriber
|
||||
co-role
|
||||
co-roles
|
||||
co-topic
|
||||
|
||||
;; Reexported from unify.rkt for convenience
|
||||
|
@ -245,20 +245,20 @@
|
|||
(and es ;; some threads are not standard-threads
|
||||
(exit-status-exception es)))
|
||||
|
||||
(define (co-role r)
|
||||
(define (co-roles r)
|
||||
(case r
|
||||
[(publisher) 'subscriber]
|
||||
[(subscriber) 'publisher]
|
||||
[(publisher) '(subscriber)]
|
||||
[(subscriber) '(publisher)]
|
||||
[else #f]))
|
||||
|
||||
(define (co-topic t)
|
||||
(struct-copy topic t [role (co-role (topic-role t))]))
|
||||
(define (co-topic t new-role)
|
||||
(struct-copy topic t [role new-role]))
|
||||
|
||||
(define (refine-topic remote-topic new-pattern)
|
||||
(struct-copy topic remote-topic [pattern new-pattern]))
|
||||
|
||||
(define (roles-intersect? l r)
|
||||
(eq? l (co-role r)))
|
||||
(memq l (co-roles r)))
|
||||
|
||||
;; Both left and right must be canonicalized.
|
||||
(define (topic-intersection left right)
|
||||
|
|
|
@ -57,7 +57,9 @@
|
|||
[(says (and specific-topic (topic 'publisher _ _)) _)
|
||||
(write `(,name acking) o)
|
||||
(newline o)
|
||||
(send handle say (co-topic specific-topic) (list name 'ack))]
|
||||
(send handle say
|
||||
(co-topic specific-topic 'subscriber)
|
||||
(list name 'ack))]
|
||||
[_ (void)])
|
||||
(flush-output o)
|
||||
(loop)))
|
||||
|
|
Loading…
Reference in New Issue