v8worker

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Aug 3, 2023 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	V8_LIBPATH_MAC   = "/usr/local/Cellar/v8/8.1.307.32/libexec"
	V8_LIBPATH_LINUX = "/usr/local/lib64/v8"
)

Variables

This section is empty.

Functions

func Version

func Version() string

Types

type RequestCallback

type RequestCallback func(worker *Worker, msgType int, msg string) string

type SendCallback

type SendCallback func(worker *Worker, msgType int, msg string, userdata int64)

type Worker

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

func New

func New(sendCb SendCallback, requestCb RequestCallback) *Worker

func (*Worker) Acquire

func (w *Worker) Acquire() bool

func (*Worker) Dispose

func (w *Worker) Dispose()

func (*Worker) Execute

func (w *Worker) Execute(scriptName string, code string) error

func (*Worker) GetExpireTime

func (w *Worker) GetExpireTime() int64

func (*Worker) Release

func (w *Worker) Release()

func (*Worker) SafeSend

func (w *Worker) SafeSend(mtype int, msg string) error

func (*Worker) Send

func (w *Worker) Send(mtype int, msg string) error

func (*Worker) SetExpireTime

func (w *Worker) SetExpireTime(expireTime int64)

func (*Worker) TerminateExecution

func (w *Worker) TerminateExecution()

Jump to

Keyboard shortcuts

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