Skip to content

Commit

Permalink
Updating docs
Browse files Browse the repository at this point in the history
  • Loading branch information
Lyudmil Danailov authored and Lyudmil Danailov committed Mar 19, 2024
1 parent e376ad1 commit 178afa5
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions lib/task_manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,9 @@ class TaskManager {
}

/**
* On the completion of a task in the p-queue, the task
* should return an array in the form of [interval, events].
* These would be set up in the taskData object accordingly in the
* correct format
* @param {object} interval
* Handles the values that the queue task has returned,
* deletes the function for the task as it's not needed anymore.
* @param {number} index
* @param {Array} newTransformedData
*/
#handleNewData(index, newTransformedData) {
Expand All @@ -45,11 +43,11 @@ class TaskManager {
}

/**
* Method for pushing the sequential intervals that are ready.
* While the loop hits sequential intervals in the taskData property,
* Method for pushing the sequential indeces that are ready.
* While the loop hits sequential indeces in the taskData property,
* the data should be pushed to the buffer array. When the while loop hits
* an undefined (yet) key of taskData, the function should stop.
* @returns Array of the events' data
* @returns Array of the last exported block, along with the array of the events' data
*/
retrieveCompleted() {
let lastExportedBlock;
Expand All @@ -66,9 +64,11 @@ class TaskManager {
}

/**
* Takes a `() => worker.work()` function and pushes it
* into the TaskManager's p-queue.
* @param {Function} workTask
* Method for generating a function, using the taskMetadata object
* and pushing it into the p-queue. The method also updates the
* taskData class property with the task indeces as keys and the taskMetadata object
* as values.
* @param {object} taskMetadata Object with interval and lambda properties
*/
pushToQueue(taskMetadata) {
this.lastTaskIndex++;
Expand Down

0 comments on commit 178afa5

Please sign in to comment.