Make delete-role idempotent

This commit is contained in:
Tony Garnock-Jones 2012-03-24 15:59:52 -04:00
parent c278e10673
commit 523446fa71
1 changed files with 27 additions and 24 deletions

View File

@ -193,6 +193,8 @@
hs))]))
(define (do-unsubscribe pid eid reason state)
(cond
[(hash-has-key? (vm-endpoints state) eid)
(define endpoint-to-remove (hash-ref (vm-endpoints state) eid))
(define removed-topic (endpoint-topic endpoint-to-remove))
(define old-process (hash-ref (vm-processes state) pid))
@ -216,7 +218,8 @@
(handlers-absence (endpoint-handlers e))
matching-eid
outbound-flow
reason))))
reason)))]
[else state]))
(define (route-and-deliver message-topic body state)
(define pids-and-endpoints