API reference › @evolu/common › Worker
Platform-agnostic Worker abstractions.
Functions
| Function | Description |
|---|---|
| createSharedWorker | Creates an in-memory SharedWorker. |
| createWorker | Creates an in-memory Worker. |
| testCreateMessageChannel | Creates an in-memory MessageChannel for testing. |
| testCreateSharedWorker | Creates a connected TestSharedWorker for testing. |
| testCreateWorker | Creates a connected TestWorker for testing. |
| testWaitForWorkerMessage | Waits long enough for multi-hop in-memory worker message delivery in tests. |
Interfaces
| Interface | Description |
|---|---|
| CreateMessageChannelDep | - |
| CreateMessagePortDep | - |
| MessageChannel | Platform-agnostic MessageChannel. |
| MessagePort | Platform-agnostic MessagePort. |
| SharedWorker | Platform-agnostic SharedWorker. |
| SharedWorkerSelf | Typed self for code running inside a shared worker. |
| 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 | Platform-agnostic Worker. |
| WorkerSelf | Typed self for code running inside a dedicated worker. |
Type Aliases
| Type Alias | Description |
|---|---|
| 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 |
|---|---|
| createMessageChannel | Creates an in-memory MessageChannel. |
| createMessagePort | Creates an in-memory MessagePort from a native token. |
| testCreateMessagePort | Creates an in-memory CreateMessagePort for testing. |