Get endowments correct #23
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
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.