engine

package
v0.37.0 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2025 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type IdleCleanupManager added in v0.33.0

type IdleCleanupManager struct {
	// contains filtered or unexported fields
}

IdleCleanupManager manages memory cleanup during idle periods It tracks image processing activity and triggers libvips cache cleanup when the system has been idle for a configured duration

func NewIdleCleanupManager added in v0.33.0

func NewIdleCleanupManager(enabled bool, timeoutMinutes int, aggressiveGC bool) *IdleCleanupManager

func (*IdleCleanupManager) BeginProcessing added in v0.34.1

func (m *IdleCleanupManager) BeginProcessing()

BeginProcessing acquires a read lock and increments the active process counter Call this before starting image processing to prevent cleanup during processing This will BLOCK if cleanup is currently running

func (*IdleCleanupManager) EndProcessing added in v0.34.1

func (m *IdleCleanupManager) EndProcessing()

EndProcessing decrements the active process counter and releases the read lock Call this after image processing completes (use defer for safety)

func (*IdleCleanupManager) GetCleanupCount added in v0.33.0

func (m *IdleCleanupManager) GetCleanupCount() int64

GetCleanupCount returns the number of cleanup operations performed Useful for monitoring and metrics

func (*IdleCleanupManager) RecordActivity added in v0.33.0

func (m *IdleCleanupManager) RecordActivity()

RecordActivity updates the last activity timestamp This is called on every image transform and must be very fast (lock-free)

func (*IdleCleanupManager) Start added in v0.33.0

func (m *IdleCleanupManager) Start()

Start launches the background cleanup goroutine

func (*IdleCleanupManager) Stop added in v0.33.0

func (m *IdleCleanupManager) Stop()

Stop gracefully shuts down the cleanup goroutine Waits for the background goroutine to finish to prevent goroutine leaks

type ImageEngine

type ImageEngine struct {
	// contains filtered or unexported fields
}

ImageEngine is main struct that is responding for image processing

func NewImageEngine

func NewImageEngine(res *response.Response) *ImageEngine

NewImageEngine create instance of ImageEngine with source file that should be processed

func (*ImageEngine) Process

func (c *ImageEngine) Process(obj *object.FileObject, trans []transforms.Transforms) (*response.Response, error)

Process main ImageEngine function that create new image (stored in response object)

Jump to

Keyboard shortcuts

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