Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ReceiveMessageCallback ¶
type ReceiveMessageCallback func(msg string)
To receive messages from javascript...
type ReceiveSyncMessageCallback ¶
To send a message from javascript and synchronously return a string.
type Worker ¶
type Worker struct {
// contains filtered or unexported fields
}
This is a golang wrapper around a single V8 Isolate.
func New ¶
func New(cb ReceiveMessageCallback, sync_cb ReceiveSyncMessageCallback) *Worker
Creates a new worker, which corresponds to a V8 isolate. A single threaded standalone execution context.
func (*Worker) Dispose ¶
func (w *Worker) Dispose()
Forcefully frees up memory associated with worker. GC will also free up worker memory so calling this isn't strictly necessary.
func (*Worker) Load ¶
Load and executes a javascript file with the filename specified by scriptName and the contents of the file specified by the param code.
func (*Worker) SendSync ¶
SendSync sends a message to a worker. The $recvSync callback in js will be called. That callback will return a string which is passed to golang and used as the return value of SendSync.
func (*Worker) TerminateExecution ¶
func (w *Worker) TerminateExecution()
Terminates execution of javascript