API reference › @evolu/common › Worker
Typed, disposable worker and messaging primitives.
Functions
| Function | Description |
|---|---|
| createSharedWorker | Creates an in-memory SharedWorker. |
| createWorker | Creates an in-memory Worker. |
| testCreateBroadcastChannel | Creates an in-memory BroadcastChannel for testing. |
| testCreateMessageChannel | Creates an in-memory MessageChannel for testing. |
| testCreateSharedWorker | Creates a connected TestSharedWorker for testing. |
| testCreateWorker | Creates a connected TestWorker for testing. |
| testWaitForWorkerMessage | Waits until scheduled in-memory worker message delivery becomes idle. |
Interfaces
| Interface | Description |
|---|---|
| BroadcastChannel | Typed, disposable BroadcastChannel. |
| CreateBroadcastChannelDep | - |
| CreateMessageChannelDep | - |
| CreateMessagePortDep | - |
| MessageChannel | Typed, disposable MessageChannel. |
| MessagePort | Typed, disposable MessagePort. |
| SharedWorker | Typed, disposable SharedWorker. |
| SharedWorkerSelf | Typed self for code running inside a shared worker. |
| TestBroadcastChannel | BroadcastChannel with disposal tracking for testing. |
| TestMessageChannel | MessageChannel with disposal tracking for testing. |
| TestSharedWorker | Test SharedWorker with direct access to self and connect. |
| TestWorker | Test Worker with access to its paired worker-side self. |
| Worker | Typed, disposable Worker. |
| WorkerSelf | Typed self for code running inside a dedicated worker. |
Type Aliases
| Type Alias | Description |
|---|---|
| CreateBroadcastChannel | Factory function to create a BroadcastChannel. |
| CreateMessageChannel | Factory function to create a MessageChannel. |
| CreateMessagePort | Factory function to create a MessagePort from a native port. |
| NativeMessagePort | Opaque type for platform-specific native MessagePort. |
| Transferable | Objects whose ownership can be transferred between threads via postMessage. |
| WorkerDeps | Common dependencies for worker entry points. |
Variables
| Variable | Description |
|---|---|
| createBroadcastChannel | Creates an in-memory BroadcastChannel. |
| createMessageChannel | Creates an in-memory MessageChannel. |
| createMessagePort | Creates an in-memory MessagePort from a native token. |
| testCreateMessagePort | Creates an in-memory CreateMessagePort for testing. |