endo
endo copied to clipboard
wip(captp): add new hooks
Changes to captp required to support ExtRefController in https://github.com/endojs/endo/pull/2473
Captp
- new hooks:
- gcHook: called when remote says they dont need your export
- onBeforeImportHook: allows you to specify a presence for a slot (similar to importHook)
- onBeforeExportHook: allows you to specify a slot for a value (similar to exportHook)
- missingExportHook: allows you to fill in an export missing from the table
- new methods:
- importSlot: you provide a new presence for a slot and captp registers it
- exportValue: you specify a value and slot and it is added to the export table
- newly exposed method:
- makeRemoteKit: sets up the HandledPromie for communicating with a remote slot, does not register the presence in the table
on the call it was suggested this could be done another way. maybe by all of:
- passing in import/export tables
- replaces
opts.gcHook(export table) - replaces
opts.missingExportHook(export table) - replaces
captp.exportValue(export table) - replaces
captp.importSlot(import table)
- replaces
- providing a slot provider
- replaces
opts.onBeforeExportHook(retrieving slot)
- replaces
- providing a presence creator
- replaces
opts.onBeforeExportHook(creating a presence)
- replaces
- still need
captp.makeRemoteKit
replaced by https://github.com/endojs/endo/pull/2564