Skip to content

feat(kernel): Setup direct MessagePort connections between vats and kernel #90

@grypez

Description

@grypez

PoC: #84

We can have the kernel and its vats communicate directly over a message port, without proxying through the offscreen glue code.

Regarding kernel <--> vat communications, the offscreen document is responsible for:

  • creating new vat workers
  • providing an introduction between the kernel and the vat
  • destroying vat workers

All other interactions between the kernel and its vats can take place directly over message ports.

Communication Diagram (Draft)

Screenshot 2024-09-24 at 12 39 06 PM

Suggested Implementation

Since it is possible to send a MessagePort over a MessagePort, we could have the kernel initialize a MessageChannel, send one end of the channel to the Glue code as part of the requests to make a new vat, immediately add the Vat abstraction to its records, and carry on as usual. As a bonus, this implementation does not require first getting the kernel into its own iframe (#57).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions