Ad-hoc serialization comity
Distributed applications running in multiple E vats should be able to exchange objects of custom types, i.e. to agree that their makers should be graph exits, without requiring that the objects be mobile code, or that the vats have matching entries in the global emaker namespace [which should go away too, but I haven't gotten to that problem yet --Kevin Reid 22:19, 26 June 2008 (CDT)]].
There are multiple tables of graph exits, called comity tables, and each CapTP eventual reference specifies one such table. Messages sent to a reference are serialized using that reference's table. PassByProxy objects in the message arguments, when unserialized on the other side, are remote references with the inverse of the original comity table.
Two eventual references are the same only if their comity tables are the same.
It is not possible to retrieve the comity table of a reference.
Eventual-send result promises share the same table as the original reference; this is appropriate as any message sent on it before it resolves will be going to the original reference's host vat for forwarding.
The 'withComity' operation introduces an agreement.
withComity(referent, table :ComityTable)
Returns a reference like referent except that the exit table is augmented with the entries in table.
A ComityTable is an object with four fields:
- exits :Map. Used as Data-E unscope for serializing arguments of messages to references having this ComityTable, except that the values are not exit names, but rather references to be used in the receiving vat.
- uncallers :List. Used as Data-E uncaller list in the same way.
- invExits :Map and invUncallers :List. When a PassByProxy reference is sent over a reference having this ComityTable, it arrives in the receiving vat having a ComityTable with these two fields exchanged with exits and uncallers.
(This proposal was invented in conversation with MarkM by --Kevin Reid 22:19, 26 June 2008 (CDT))