olin: within.website/olin/internal/cwagi Index | Files

package cwagi

import "within.website/olin/internal/cwagi"

Index

Package Files

cwagi.go vmpool.go

type VMPool Uses

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

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

func NewPool Uses

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 Uses

func (vp *VMPool) Close() error

func (*VMPool) ServeHTTP Uses

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

type VMServer Uses

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 Uses

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 Uses

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

Package cwagi imports 19 packages (graph). Updated 2019-06-09. Refresh now. Tools for package owners.