Get endowments correct #23

Open
opened 2025-06-03 19:50:34 +00:00 by john · 0 comments
Owner

For SDL, for example, with the window ...

An endowment is a C stub that allows direct access to windows, and so on. Endowments are granted to actors in the cell.toml, or possibly endowments.toml file inside .cell. They're heavily restricted. It may even be that only a single actor is granted access to using the endowment.

So a 'sdl/window' actor gets the 'window' endowment; an actor can then start 'sdl/window', sending a config, and the 'sdl/window' actor, on startup, will create a window, and then the actor who created it can start sending messages to manipulate the window.

Another possibility is to package that endowment into a module. So a 'sdl/window' module that an actor imports can pass the C stub straight through to the actor, if desired; or, it could attenuate the power by only passing a subset of the functions through; or only allow the using actor to create a single window; and so on.

A key restriction to consider is that, for example, SDL window must run on the main thread. So actors that import it or are endowed with it need main thread priority.

For SDL, for example, with the window ... An endowment is a C stub that allows direct access to windows, and so on. Endowments are granted to actors in the cell.toml, or possibly endowments.toml file inside .cell. They're heavily restricted. It may even be that only a single actor is granted access to using the endowment. So a 'sdl/window' actor gets the 'window' endowment; an actor can then start 'sdl/window', sending a config, and the 'sdl/window' actor, on startup, will create a window, and then the actor who created it can start sending messages to manipulate the window. Another possibility is to package that endowment into a module. So a 'sdl/window' module that an actor imports can pass the C stub straight through to the actor, if desired; or, it could attenuate the power by only passing a subset of the functions through; or only allow the using actor to create a single window; and so on. A key restriction to consider is that, for example, SDL window must run on the main thread. So actors that import it or are endowed with it need main thread priority.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: john/cell#23
No description provided.