filter-event
This commit is contained in:
parent
8050324f5b
commit
20a50967c5
|
@ -35,6 +35,7 @@
|
|||
sub
|
||||
pub
|
||||
gestalt-accepts?
|
||||
filter-event
|
||||
|
||||
send
|
||||
feedback
|
||||
|
@ -131,6 +132,14 @@
|
|||
(match-define (message b ml f?) m)
|
||||
(not (set-empty? (gestalt-match-value g b ml f?))))
|
||||
|
||||
;; (Option Event) Gestalt -> (Option Event)
|
||||
;; Returns a filtered version of e, narrowed to the perspective of g-filter.
|
||||
(define (filter-event e g-filter)
|
||||
(match e
|
||||
[#f #f]
|
||||
[(routing-update g) (routing-update (gestalt-filter g g-filter))]
|
||||
[(? message? m) (and (gestalt-accepts? g-filter m) m)]))
|
||||
|
||||
;; Behavior Any [Gestalt] -> Action
|
||||
;; Constructs a spawn Action for a new process with the given behavior
|
||||
;; and state. If a Gestalt is supplied, the new process will begin its
|
||||
|
|
Loading…
Reference in New Issue