This PR exposes an optional configuration for captp that allows you to:
manage the import/export tables
construct the presences for imported remote values
specify slots for exported values
This may be useful If you want:
make import/export tables persist across captp "sessions" (make the references non-brittle to network issues)
to customize captp remote presences (eg make them lazily initiate captp connections when used)
This change was motivated by working on the ExternalReferenceController of the gems experiment, which enabled durable imported presences with lazy captp connections re-established on use.
This PR exposes an optional configuration for captp that allows you to:
This may be useful If you want:
This change was motivated by working on the
ExternalReferenceController
of the gems experiment, which enabled durable imported presences with lazy captp connections re-established on use.This is an alternate implementation of https://github.com/endojs/endo/pull/2562, which ended up duplicating import/export tables inside and above captp.
ExtRefController migration notes from alternative implementation:
opts.gcHook
(export table)opts.missingExportHook
(export table)captp.exportValue
(export table)captp.importSlot
(import table)opts.onBeforeExportHook
(retrieving slot)opts.onBeforeExportHook
(creating a presence)captp.makeRemoteKit