Documentation
¶
Overview ¶
Package node is the image processor for hosts that load Photon's WebAssembly from an installed package.
Ports packages/durable/src/images/node.ts and node-worker.ts.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateNodePhotonImages ¶
func CreateNodePhotonImages(options *NodePhotonImagesOptions) (tools.ImageProcessor, error)
CreateNodePhotonImages is images.CreatePhotonImages for Node and Bun, by default behind a worker that keeps its goroutine only while it prepares an image and for IdleMs after. The Go processor decodes and encodes natively, so there is no WebAssembly to read and the worker always starts (Pi falls back to the calling thread when it cannot); the error is the one Pi's promise carries. A nil options value is the defaults.
Types ¶
type NodePhotonImagesOptions ¶
type NodePhotonImagesOptions struct {
// Worker prepares images on one worker goroutine, one at a time, so a large photo does not run on the caller's
// goroutine. Default true; false prepares them with images.CreatePhotonImages on the caller's goroutine, one at a time in
// call order.
Worker *bool
// IdleMs is how long the worker stays after its last image before it exits. The next image starts a new one.
// Default 30000.
IdleMs *int
}
NodePhotonImagesOptions configures CreateNodePhotonImages.
Click to show internal directories.
Click to hide internal directories.