worker

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Feb 4, 2026 License: MIT Imports: 15 Imported by: 0

Documentation

Overview

Package worker contiene la lógica del procesador de trabajos de impresión.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ClientNotifier

type ClientNotifier interface {
	NotifyClient(conn *websocket.Conn, response server.Response) error
}

ClientNotifier interface for sending results back to clients

type Config

type Config struct {
	DefaultPrinter string // Fallback printer name if not specified in document
}

Config holds worker configuration

type Statistics

type Statistics struct {
	IsRunning     bool      `json:"is_running"`
	JobsProcessed int64     `json:"jobs_processed"`
	JobsFailed    int64     `json:"jobs_failed"`
	LastJobTime   time.Time `json:"last_job_time,omitempty"`
}

Statistics holds worker runtime statistics

type Worker

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

Worker consumes print jobs from the queue and executes them via Poster

func NewWorker

func NewWorker(jobQueue <-chan *server.PrintJob, notifier ClientNotifier, config Config) *Worker

NewWorker creates a new print worker

func (*Worker) Start

func (w *Worker) Start()

Start begins the worker goroutine

func (*Worker) Stats

func (w *Worker) Stats() Statistics

Stats returns current worker statistics

func (*Worker) Stop

func (w *Worker) Stop()

Stop gracefully stops the worker

Jump to

Keyboard shortcuts

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