API reference@evolu/common › Worker

Platform-agnostic Worker abstractions.

Functions

FunctionDescription
createSharedWorkerCreates an in-memory SharedWorker.
createWorkerCreates an in-memory Worker.
testCreateMessageChannelCreates an in-memory MessageChannel for testing.
testCreateSharedWorkerCreates a connected TestSharedWorker for testing.
testCreateWorkerCreates a connected TestWorker for testing.
testWaitForWorkerMessageWaits long enough for multi-hop in-memory worker message delivery in tests.

Interfaces

InterfaceDescription
CreateMessageChannelDep-
CreateMessagePortDep-
MessageChannelPlatform-agnostic MessageChannel.
MessagePortPlatform-agnostic MessagePort.
SharedWorkerPlatform-agnostic SharedWorker.
SharedWorkerSelfTyped self for code running inside a shared worker.
TestMessageChannelMessageChannel with disposal tracking for testing.
TestSharedWorkerTest SharedWorker with direct access to self and connect.
TestWorkerTest Worker with access to its paired worker-side self.
WorkerPlatform-agnostic Worker.
WorkerSelfTyped self for code running inside a dedicated worker.

Type Aliases

Type AliasDescription
CreateMessageChannelFactory function to create a MessageChannel.
CreateMessagePortFactory function to create a MessagePort from a native port.
NativeMessagePortOpaque type for platform-specific native MessagePort.
TransferableObjects whose ownership can be transferred between threads via postMessage.
WorkerDepsCommon dependencies for worker entry points.

Variables

VariableDescription
createMessageChannelCreates an in-memory MessageChannel.
createMessagePortCreates an in-memory MessagePort from a native token.
testCreateMessagePortCreates an in-memory CreateMessagePort for testing.