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.
Click to show internal directories.
Click to hide internal directories.