cwagi

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Dec 11, 2019 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type VMPool

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

VMPool is a group of WebAssembly virtual machines dynamically spun up and down.

func NewPool

func NewPool(module []byte, name, mainFunc string, initSize, maxSize int) *VMPool

NewPool creates a new pool of WebAssembly workers with the given cwagi-linked code.

func (*VMPool) Close

func (vp *VMPool) Close() error

func (*VMPool) ServeHTTP

func (vp *VMPool) ServeHTTP(w http.ResponseWriter, r *http.Request)

type VMServer

type VMServer struct {
	VM *exec.VirtualMachine
	P  *cwa.Process
	// contains filtered or unexported fields
}

VMServer wraps a single WebAssembly virtual machine around a HTTP style handler.

func NewVM

func NewVM(data []byte, argv []string, name, mainFunc string) (*VMServer, error)

NewVM creates a new virtual machine with the given WebAssembly binary code and name.

func (*VMServer) ServeHTTP

func (v *VMServer) ServeHTTP(w http.ResponseWriter, r *http.Request)

Jump to

Keyboard shortcuts

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