From 838bde3740c17f39b3f57a0ec16770ca5b6ca3d9 Mon Sep 17 00:00:00 2001 From: Tony Garnock-Jones Date: Wed, 24 Oct 2018 13:21:20 +0100 Subject: [PATCH] Supply #f as cleanup function in multicast udp-dataspace, instead of void; notes on cleanup functions and visibility-restrictions --- syndicate/HOWITWORKS.md | 24 ++++++++++++++++++++++++ syndicate/mc/udp-dataspace.rkt | 2 +- 2 files changed, 25 insertions(+), 1 deletion(-) diff --git a/syndicate/HOWITWORKS.md b/syndicate/HOWITWORKS.md index 7ad4761..2a824c0 100644 --- a/syndicate/HOWITWORKS.md +++ b/syndicate/HOWITWORKS.md @@ -509,7 +509,31 @@ interested in the `present` constructor. # TODO - describe the cleanup function associated with a handler in the real implementation + - `relay.rkt` uses it. When an inner actor asserts interest in an + inbound assertion-set, the relay process pivots into the outer + dataspace's context, and adds a new endpoint that relays events + to the inner dataspace. The cleanup function attached to that + endpoint retracts (from the inner dataspace) any matching + assertions left over at the time the endpoint is removed. + - that appears to be it! Nowhere else in the code is a + `skeleton-interest` constructed with a non-`#f` cleanup + function. - figure out and describe scoped assertions / visibility-restrictions + - (partial/sketchy answer:) It's to deal with the fact that + multiple endpoints may overlap. Within a single dataspace, an + assertion matching both endpoints will trigger each of them. + When relaying, the relay maintains an endpoint in the outer + space for each in the inner space. When both outer endpoints are + triggered, if they were to naively relay the matching assertion, + the problem isn't so much that they'd double up (because + dataspaces deduplicate!), the problem is that they don't have + enough information to reconstruct the triggering outer assertion + perfectly! So a visibility-restriction causes an assertion to + *only* trigger inner endpoints that capture *exactly* the + captures of the outer endpoint. One of the outer endpoints will + trigger its "matching" inner endpoint, but not the inner + endpoint of the other endpoint, even though you might expect the + relayed assertion to do so.