API reference › @evolu/common › Worker
Typed, disposable worker and messaging primitives.
Core
| Name | Description |
|---|---|
| BroadcastChannel | Typed, disposable BroadcastChannel. |
| MessageChannel | Typed, disposable MessageChannel. |
| MessagePort | Typed, disposable MessagePort. |
| SharedWorker | Typed, disposable SharedWorker. |
| SharedWorkerSelf | Typed self for code running inside a shared worker. |
| Worker | Typed, disposable Worker. |
| WorkerSelf | Typed self for code running inside a dedicated worker. |
| 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. |
Construction
| Name | Description |
|---|---|
| CreateBroadcastChannelDep | Dependency wrapper for CreateBroadcastChannel. |
| CreateMessageChannelDep | Dependency wrapper for CreateMessageChannel. |
| CreateMessagePortDep | Dependency wrapper for CreateMessagePort. |
| 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. |
| createBroadcastChannel | Creates an in-memory BroadcastChannel. |
| createMessageChannel | Creates an in-memory MessageChannel. |
| createMessagePort | Creates an in-memory MessagePort from a native token. |
| createSharedWorker | Creates an in-memory SharedWorker. |
| createWorker | Creates an in-memory Worker. |
Testing
| Name | Description |
|---|---|
| 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. |
| testCreateMessagePort | Creates an in-memory CreateMessagePort for testing. |
| 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. |