-
Notifications
You must be signed in to change notification settings - Fork 212
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Connection and multicast semantics for command device #748
Comments
This anticipates support for #748 in the command device.
Hm. My instinct is to be anxious about extending the communication pathways with non-CapTP-ish channels, because of how the other side is not obligated to be as deterministic and "waterken like" as real Vats are. But we've discussed that before and I think I came away thinking it might be possible to pull off. We definitely need to pay close attention to the impedance-mismatch between the external notion of "connection" (TCP or WebSocket connections, which can appear or drop at any time), and the vat's notions (where vats only hear about messages from devices). In particular the way we manage state: the devices will keep some state on the heap (including references to HTTP channel objects, which obviously can't go anywhere else), and some state in the kernel. They must be prepared to wake up after a restart and deal with the difference. It's like someone holding a phone in their hand and then they blink and the phone is gone, but they still remember things about the conversation they were having a moment ago. Removing |
@warner, thanks for your review. I'd suggest renaming what I've called "connection" to be just "channel" (to reflect the difference between external notions and the command device's notion) and changing I like the distinction we already have between the new |
This anticipates support for #748 in the command device.
This was an interesting discussion, but in order to make progress on this we're going to have to come up with a better device/design. |
The current SwingSet command device provides a simple request/response(or rejection) implementation and a separate
sendBroadcast
implementation. This is not very flexible for splitting up the HTTP/WebSocket handlers into separate objects, each with their own set of peers that are subscribing to them.It would be useful to add the notion of a "connection" to the command device. Essentially, the SwingSet host could call
command.setConnection(connectionID, sendFn = undefined)
which would associate or remove asendFn
with a connectionID (a Nat).inboundCommand
would then take an optional second argument, theconnectionID
. Then, on the kernel side of the device, these functions would result in callbacks of:The command device outer half would translate these calls into one of the following:
Each
connectionHandle
would be an opaque object that the outer half of the command device would associate with internal connectionIDs, for ocap hygiene (so that the client code doesn't see the IDs). Then, the outer half of the command device would provide:When the host starts up, it could get a list of active (i.e. saved in the device state) connectionIDs, and explicitly close them (or for resumable connections, associate a new
sendFn
with them).We may want to remove the old
sendBroadcast
as it assumes all connections are equal and is basically an ambient authority.The text was updated successfully, but these errors were encountered: