Module internals

Source
Expand description

Internal implementation details

Consumer should only import from @pistonite/workex, which re-exports all public APIs and types. Importing from @pistonite/workex/internals is considered unstable.

See public.

Type Aliases§

WxOnRecvFn

Function type for the onRecv handler on message controller/ends

Functions§

isWxMessageEvent

Validate the received data is a valid workex message

wxFail
wxMakeChannel

Create a channel with 2 ends that can communicate with each other in the same context. Calling send from one end will call the onRecv callback of the other end asynchronously. Calling close on either end will close the channel immediately (any message sent but not received will also not be received).

wxMakeMessageController

Create a WxMessageController that handles the lowest level of message passing using MesasgeEvents

wxMakeWorkerEnd

Create a WxEnd for messaging to a Worker or WorkerGlobalScope.

wxMakeWorkerGlobalEnd

Create an WxEnd bound to the global WorkerGlobalScope.

wxWindow

Create a new WxWindow that wraps the global Window object

Interfaces§

WxEnd

Messaging primitive representing one end of an established messaging channel

WxEndOptions
WxMessage

Message object with the s field set to "workex" to not be confused with messages with other libraries

WxMessageController

Controller for the lowest level of message passing using MessageEvents. This is used internally by WxEnd

WxPayload

Payload sendable to a WxEnd