naptha / tesseract.js

Pure Javascript OCR for more than 100 Languages 📖🎉🖥
http://tesseract.projectnaptha.com/
Apache License 2.0
35.31k stars 2.23k forks source link

Expose workers within scheduler #855

Open Balearica opened 12 months ago

Balearica commented 12 months ago

Overview

We should add an interface for directly accessing all workers in a scheduler.

Motivation

Say you have a scheduler that contains 4 workers, and want to change some configuration parameter on all workers. This is a reasonable thing to want, however there is currently no easy way to do this.

  1. Passing a setParameters job through the scheduler is not correct, as the scheduler assumes all workers are homogenous and assigns jobs to the next available worker
  2. Directly accessing the workers in a scheduler is not currently possible

Therefore, one would need to create a separate array and add all workers to that array in addition to adding them to the scheduler.