Skip to content

refactor(extension,streams): Abstract vat logic from platform-specific implementation details #56

@grypez

Description

@grypez

Requires: #52

Our current incarnation of a vat lives in an iframe. Other vats may wish to live in realms as far flung as nodejs processes or the xsnap-wasm runtime. The vat operation ought to be consistent across these realms, implying an abstraction barrier to be discovered.

A vat, provided an abstract realm during construction, ought to be able to respond to the vat management api without worry for the realm details.

In particular, vats communicate with the kernel over an @ocap/streams/StreamPair, and should be able to use the realm's methods to implement the following:

  • launch
  • stop
  • terminate

As an example, when the realm of the vat is an iframe: launch should create if it does not exist an iframe with a DOM id unique to that vat; terminate should clean up that iframe. It is worth noting that in the case of an iframe realm, the stream over which the vat communicates cannot exist until the vat is launched.

Metadata

Metadata

Assignees

Labels

critical pathHigh-priority issues that structure the rest of our workenhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions