task

package
v0.0.0-...-a2b917b Latest Latest
Warning

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

Go to latest
Published: Jan 30, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Process

type Process struct {
	*events.EventEmitterBase
	// contains filtered or unexported fields
}

func NewProcess

func NewProcess(t *WorkerTask) *Process

func (*Process) Args

func (c *Process) Args() []string

func (*Process) Argv

func (c *Process) Argv() []string

func (*Process) Cwd

func (c *Process) Cwd() string

func (*Process) Env

func (c *Process) Env() map[string]string

func (*Process) Exit

func (c *Process) Exit(exitCode int) error

func (*Process) NextTick

func (c *Process) NextTick(in isolates.FunctionArgs) (*isolates.Value, error)

func (*Process) Platform

func (c *Process) Platform() string

func (*Process) Stderr

func (c *Process) Stderr() stream.Writable

func (*Process) Stdin

func (c *Process) Stdin() stream.Readable

func (*Process) Stdout

func (c *Process) Stdout() stream.Writable

func (*Process) Task

func (c *Process) Task() *WorkerTask

func (*Process) V8Construct

func (p *Process) V8Construct(in isolates.FunctionArgs)

func (*Process) V8FuncCwd

func (c *Process) V8FuncCwd(in isolates.FunctionArgs) (*isolates.Value, error)

func (*Process) V8FuncExit

func (c *Process) V8FuncExit(in isolates.FunctionArgs) (*isolates.Value, error)

func (*Process) V8FuncNextTick

func (c *Process) V8FuncNextTick(in isolates.FunctionArgs) (*isolates.Value, error)

func (*Process) V8GetArgs

func (c *Process) V8GetArgs(in isolates.GetterArgs) (*isolates.Value, error)

func (*Process) V8GetArgv

func (c *Process) V8GetArgv(in isolates.GetterArgs) (*isolates.Value, error)

func (*Process) V8GetEnv

func (c *Process) V8GetEnv(in isolates.GetterArgs) (*isolates.Value, error)

func (*Process) V8GetPlatform

func (c *Process) V8GetPlatform(in isolates.GetterArgs) (*isolates.Value, error)

func (*Process) V8GetStderr

func (c *Process) V8GetStderr(in isolates.GetterArgs) (*isolates.Value, error)

func (*Process) V8GetStdin

func (c *Process) V8GetStdin(in isolates.GetterArgs) (*isolates.Value, error)

func (*Process) V8GetStdout

func (c *Process) V8GetStdout(in isolates.GetterArgs) (*isolates.Value, error)

func (*Process) V8GetTask

func (c *Process) V8GetTask(in isolates.GetterArgs) (*isolates.Value, error)

func (*Process) V8GetVersion

func (c *Process) V8GetVersion(in isolates.GetterArgs) (*isolates.Value, error)

func (*Process) V8GetVersions

func (c *Process) V8GetVersions(in isolates.GetterArgs) (*isolates.Value, error)

func (*Process) Version

func (c *Process) Version() (string, error)

func (*Process) Versions

func (c *Process) Versions() *Versions

type TaskOptions

type TaskOptions struct {
	FS        fs.FS
	Requires  []string
	Script    string
	Stdin     io.ReadCloser
	Stdout    io.WriteCloser
	Stderr    io.WriteCloser
	Env       map[string]string
	Arguments []string
}

type Ticker

type Ticker struct {
	*time.Ticker
	StopC chan bool
}

type Versions

type Versions struct {
	Node string `v8:"node"`
}

type WorkerTask

type WorkerTask struct {
	FS fs.FS `v8:"fs"`
	// contains filtered or unexported fields
}

func NewTask

func NewTask(options TaskOptions) (*WorkerTask, error)

func (*WorkerTask) ClearInterval

func (c *WorkerTask) ClearInterval(ticker int64)

func (*WorkerTask) ClearTimeout

func (c *WorkerTask) ClearTimeout(timer int64)

func (*WorkerTask) Clone

func (t *WorkerTask) Clone() (*WorkerTask, error)

func (*WorkerTask) ExitCode

func (t *WorkerTask) ExitCode() int

func (*WorkerTask) GetExecutionContext

func (t *WorkerTask) GetExecutionContext() context.Context

func (*WorkerTask) GetIsolate

func (c *WorkerTask) GetIsolate() *isolates.Isolate

func (*WorkerTask) OnTerminate

func (t *WorkerTask) OnTerminate(callback func() error) func()

func (*WorkerTask) Ref

func (c *WorkerTask) Ref()

func (*WorkerTask) SetExitCode

func (t *WorkerTask) SetExitCode(exitCode int)

func (*WorkerTask) SetInterval

func (c *WorkerTask) SetInterval(ctx context.Context, callback *isolates.Value, duration time.Duration) (int64, error)

func (*WorkerTask) SetTimeout

func (c *WorkerTask) SetTimeout(callback *isolates.Value, duration time.Duration) (int64, error)

func (*WorkerTask) Start

func (t *WorkerTask) Start() error

func (*WorkerTask) Stats

func (c *WorkerTask) Stats(ctx context.Context) (*isolates.Value, error)

func (*WorkerTask) Stop

func (t *WorkerTask) Stop() error

func (*WorkerTask) Terminate

func (c *WorkerTask) Terminate()

func (*WorkerTask) TimeCounter

func (c *WorkerTask) TimeCounter(ctx context.Context) (*util.Counter, error)

func (*WorkerTask) Unref

func (c *WorkerTask) Unref()

func (*WorkerTask) V8FuncClearInterval

func (c *WorkerTask) V8FuncClearInterval(in isolates.FunctionArgs) (*isolates.Value, error)

func (*WorkerTask) V8FuncClearTimeout

func (c *WorkerTask) V8FuncClearTimeout(in isolates.FunctionArgs) (*isolates.Value, error)

func (*WorkerTask) V8FuncCreateTask

func (c *WorkerTask) V8FuncCreateTask(taskFS fs.FS, requires []string, taskPath string) (*WorkerTask, error)

func (*WorkerTask) V8FuncSetImmediate

func (c *WorkerTask) V8FuncSetImmediate(in isolates.FunctionArgs) (*isolates.Value, error)

func (*WorkerTask) V8FuncSetInterval

func (c *WorkerTask) V8FuncSetInterval(in isolates.FunctionArgs) (*isolates.Value, error)

func (*WorkerTask) V8FuncSetTimeout

func (c *WorkerTask) V8FuncSetTimeout(in isolates.FunctionArgs) (*isolates.Value, error)

func (*WorkerTask) V8FuncWait

func (t *WorkerTask) V8FuncWait(in isolates.FunctionArgs) (*isolates.Value, error)

func (*WorkerTask) V8GetExitCode

func (t *WorkerTask) V8GetExitCode(in isolates.GetterArgs) (*isolates.Value, error)

func (*WorkerTask) V8GetStats

func (c *WorkerTask) V8GetStats(in isolates.GetterArgs) (*isolates.Value, error)

func (*WorkerTask) V8GetTimeCounter

func (c *WorkerTask) V8GetTimeCounter(in isolates.GetterArgs) (*isolates.Value, error)

func (*WorkerTask) Wait

func (t *WorkerTask) Wait(ctx context.Context) (int, error)

type WorkerTaskStats

type WorkerTaskStats struct {
	Contexts                int           `v8:"contexts"`
	Values                  int           `v8:"values"`
	Receivers               int           `v8:"receivers"`
	ComputeDuration         time.Duration `v8:"computeDuration"`
	ComputeDuration5        time.Duration `v8:"computeDuration5"`
	ComputeDuration15       time.Duration `v8:"computeDuration15"`
	ComputeDuration30       time.Duration `v8:"computeDuration30"`
	ComputeDuration60       time.Duration `v8:"computeDuration60"`
	ComputeDuration120      time.Duration `v8:"computeDuration120"`
	DoesZapGarbage          bool          `v8:"doesZapGarbage"`
	HeapSizeLimit           uint64        `v8:"heapSizeLimit"`
	MallocedMemory          uint64        `v8:"mallocedMemory"`
	PeakMallocedMemory      uint64        `v8:"peakMallocedMemory"`
	TotalAvailableSize      uint64        `v8:"totalAvailableSize"`
	TotalHeapSize           uint64        `v8:"totalHeapSize"`
	TotalHeapSizeExecutable uint64        `v8:"totalHeapSizeExecutable"`
	TotalPhysicalSize       uint64        `v8:"totalPhysicalSize"`
	UsedHeapSize            uint64        `v8:"usedHeapSize"`
}

func NewWorkerTaskStats

func NewWorkerTaskStats() *WorkerTaskStats

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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