gowasm

package
v1.15.2 Latest Latest
Warning

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

Go to latest
Published: Jul 15, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrCallbackInvalid = errors.New("invalid callback ID")
	ErrCallbackUsed    = errors.New("callback channel is already closed")
)
View Source
var (
	Stdout = newConsoleWriter(syscall.Stdout)
	Stderr = newConsoleWriter(syscall.Stderr)
)

Functions

func AwaitCallback

func AwaitCallback(cbID CallbackID) error

AwaitCallback await for async operation to complete using callback ID.

func NotifyResult

func NotifyResult(cb CallbackID, result Result)

NotifyResult publishes callback result and notifies listener.

This method is intended to be called only from JS side and kept public only for testing purposes.

func ReleaseCallback

func ReleaseCallback(cbId CallbackID)

ReleaseCallback releases acquired callback.

Types

type CallbackID

type CallbackID = int

func RequestCallback

func RequestCallback() CallbackID

RequestCallback requests a new callback to await for async operation.

type Result

type Result = int

func AwaitResult

func AwaitResult(cbID CallbackID) (Result, error)

AwaitResult awaits for callback completion and returns raw result.

Directories

Path Synopsis
Package wlog implements a simple logging package for internal WASM workers use.
Package wlog implements a simple logging package for internal WASM workers use.

Jump to

Keyboard shortcuts

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