ps

package
v1.0.33 Latest Latest
Warning

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

Go to latest
Published: Feb 4, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EventHandler

type EventHandler struct {
	OnBeforeExecute OnBeforeExecute
	OnExecute       OnExecute
	OnBeforeStart   OnBeforeStart
	OnStop          OnStop
	OnScanner       OnScanner
	StopTimeoutMs   int64
}

func NewExiftoolHandler

func NewExiftoolHandler() EventHandler

type OnBeforeExecute

type OnBeforeExecute func(stdin io.WriteCloser, cmd string, flags *[]*string) error

type OnBeforeStart

type OnBeforeStart func(cmd string, flags []string) []string

type OnExecute

type OnExecute func(stdin io.WriteCloser, cmd string, flags *[]*string) error

type OnScanner

type OnScanner func(scanner *bufio.Scanner, cmd string)

type OnStop

type OnStop func(stdin io.WriteCloser, cmder *exec.Cmd, cmd string)

type Pool

type Pool struct {
	sync.Mutex
	// contains filtered or unexported fields
}

Pool creates multiple stay open exiftool instances and spreads the work across them with a simple round robin distribution.

func NewPool

func NewPool(h EventHandler, cmd string, num int, flags ...string) (*Pool, error)

func (*Pool) Execute

func (p *Pool) Execute(flags ...string) ([]byte, error)

func (*Pool) Stop

func (p *Pool) Stop()

type Stayopen

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

Stayopen abstracts running cmd with `-stay_open` to greatly improve performance. Remember to call Stayopen.Stop() to signal cmd to shutdown to avoid zombie perl processes

func NewStayOpen

func NewStayOpen(h EventHandler, cmd string, flags ...string) (*Stayopen, error)

func (*Stayopen) Stop

func (s *Stayopen) Stop()

Jump to

Keyboard shortcuts

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