This prototype property decorator factory Spawns a Worker and wraps and assigns the resulting Remote to the decorated prototype property.
The worker module name or Endpoint to Spawn.
worker
Optional
An optional Kernel.Module source.
source
A prototype property decorator.
Spawn a Worker:
import { Spawn, type Thread } from '@sgrud/core';import { type ExampleWorker } from 'example-worker';export class ExampleWorkerHandler { @Spawn('example-worker') public readonly worker!: Thread<ExampleWorker>;} Copy
import { Spawn, type Thread } from '@sgrud/core';import { type ExampleWorker } from 'example-worker';export class ExampleWorkerHandler { @Spawn('example-worker') public readonly worker!: Thread<ExampleWorker>;}
Thread
Generated using TypeDoc
This prototype property decorator factory Spawns a Worker and wraps and assigns the resulting Remote to the decorated prototype property.