Skip to main content

Module host

Module host 

Source
Expand description

The designer host: a child process of the IDE (yog designer-host) that loads a mod’s library built for this machine (yog designer-lib) and draws the mod’s custom .yui components through the same recording YogGfxApi the designer uses — the mod’s own yog-ui and build code, out of the IDE’s process, so a panicking/crashing/looping component (or a rebuilt library) costs a restart of the host, never the IDE.

Protocol: a [HostRequest] per frame of binary Yog Data on stdin, a [HostReply] per frame on stdout, each after MARK (the mod’s code may print to stdout too; [next_answer] skips what it prints).

  • Load → Loaded (the mod’s components)
  • Render → Drawn (its size and what it drew, at the origin; w/h ≤ 0: natural size)
  • Png → Written: the same, rasterized into out (for checking a component from a shell)

Constants§

COMMAND
The CLI command that runs a host.
MARK
Starts every answer on stdout.

Functions§

serve
yog designer-host: serves requests until stdin closes.