Open pr1sm opened 5 years ago
With #442, maybe we should add a "Manager" implementation that is data agnostic, but includes the basic starting/stopping logic, as well as proxy swapping management. We can then add a "TaskManager" that includes captcha token management and task runner related implementations, and then add a "MonitorManager" for #442.
Not sure how difficult this would be, but we would also need to think about a "SplitContextManager" as well. We get into some hairy situations due to multiple inheritance not being supported in JS (does a "SplitProcessTaskManager" extend from "TaskManager" or "SplitContextManager"?). Maybe some type of Mixin pattern that adds methods to the prototype for split contexts?
Split Task Manager up into the top-level "TaskManager API" and "SimpleTaskManager"
TaskManager API - This includes all shared functions (proxy swapping, start/stop management, etc.) SimpleTaskManager - the base implementation of setup and cleanup using a single thread. This would create a "Context" object similar to the SplitContextManager implementations so implementation of function in the TaskManager API would always be interacting with a "Context" object instead of worrying about accessing a "TaskRunner" instance directly.