Back to the original flow-visibility rules

This commit is contained in:
Tony Garnock-Jones 2012-03-24 19:13:09 -04:00
parent a7b4dec151
commit ebbd589e88
1 changed files with 22 additions and 10 deletions

32
os2.rkt
View File

@ -144,6 +144,14 @@
(and (roles-intersect? (topic-role left) (topic-role right)) (and (roles-intersect? (topic-role left) (topic-role right))
(mgu-canonical (freshen (topic-pattern left)) (freshen (topic-pattern right))))) (mgu-canonical (freshen (topic-pattern left)) (freshen (topic-pattern right)))))
;; True iff the flow between remote-topic and local-topic should be
;; visible to the local peer. This is the case when either local-topic
;; is virtual (in which case everything is seen) or otherwise if
;; remote-topic is also not virtual.
(define (flow-visible? local-topic remote-topic)
(or (topic-virtual? local-topic)
(not (topic-virtual? remote-topic))))
;;--------------------------------------------------------------------------- ;;---------------------------------------------------------------------------
;; QuasiQueue<X> ;; QuasiQueue<X>
@ -216,16 +224,20 @@
#:when flow-pattern) #:when flow-pattern)
(define inbound-flow (refine-topic matching-topic flow-pattern)) (define inbound-flow (refine-topic matching-topic flow-pattern))
(define outbound-flow (refine-topic topic flow-pattern)) (define outbound-flow (refine-topic topic flow-pattern))
(let* ((state (run-trapk state (let* ((state (if (flow-visible? topic inbound-flow)
pid (run-trapk state
(handlers-presence hs) pid
new-eid (handlers-presence hs)
inbound-flow)) new-eid
(state (run-trapk state inbound-flow)
matching-pid state))
(handlers-presence (endpoint-handlers e)) (state (if (flow-visible? matching-topic outbound-flow)
matching-eid (run-trapk state
outbound-flow))) matching-pid
(handlers-presence (endpoint-handlers e))
matching-eid
outbound-flow)
state)))
state)) state))
[processes (hash-set (vm-processes state) [processes (hash-set (vm-processes state)
pid pid