node

package
v0.5.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 19, 2026 License: MIT Imports: 6 Imported by: 0

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL