Create CaptchaHandler Class
pr1sm opened this issue · 0 comments
pr1sm commented
Create a CaptchaHandler class in the task-runner package abstracts the events related to sending/receiving captcha tokens. This captcha handler class will act as a wrapper around the event-based communication with the TaskManager (and frontend) and provide a promise-based API for the TaskRunner to consume.
Specifically, the following functions will be added:
- requestCaptcha - Return a promise that resolves to the next available captcha. If this is the first time calling the method, the CaptchaHandler will send the initial event to start harvesting.
- stopHarvesting - Returns void. Captcha Handler will emit an event to notify the TaskManager (and frontend) that captchas are no longer required.