Fake Mirrors
    Preparing search index...

    Class BullAnalyzeWorker

    Bull-based analyze worker implementation.

    Depends:

    import { DIContainer } from '@famir/common'
    import { ANALYZE_WORKER, AnalyzeWorker, BullAnalyzeWorker } from '@famir/consumer'

    // Get container singleton
    const container = DIContainer.getInstance()

    // Register dependency in container
    BullAnalyzeWorker.register(container)

    // Resolve dependency from container
    const analyzeWorker = container.resolve<AnalyzeWorker>(ANALYZE_WORKER)

    // Run worker
    await analyzeWorker.run()

    // Close worker
    await analyzeWorker.close()

    Implements

    • Gracefully closes the worker.

      The worker stops processing new jobs and waits for current jobs to complete. This method should be called during application shutdown to ensure all pending jobs are completed and resources are released.

      Returns Promise<void>

      BootstrapError If the worker cannot be closed properly.

    • Starts the worker, enabling it to process jobs.

      The worker will begin processing jobs from the queue based on its specification. This method should be called during application bootstrap after all processors have been registered with the router.

      Returns Promise<void>

      BootstrapError If the worker cannot be started.