• This project
    • Loading...
  • Sign in

김진우 / YTMT

%ea%b7%b8%eb%a6%bc1
Go to a project
Toggle navigation Toggle navigation pinning
  • Projects
  • Groups
  • Snippets
  • Help
  • Project
  • Activity
  • Repository
  • Pipelines
  • Graphs
  • Issues 0
  • Merge Requests 0
  • Wiki
  • Snippets
  • Network
  • Create a new issue
  • Builds
  • Commits
  • Issue Boards
  • Files
  • Commits
  • Network
  • Compare
  • Branches
  • Tags
Switch branch/tag
  • YTMT
  • node_modules
  • puppeteer
  • lib
  • TaskQueue.js
  • 김진우's avatar
    구글, 네이버 로그인 구현 · 69fe33b6
    69fe33b6
    김진우 authored 2019-11-29 20:17:40 +0900
TaskQueue.js 301 Bytes
Raw Blame History Permalink
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
class TaskQueue {
  constructor() {
    this._chain = Promise.resolve();
  }

  /**
   * @param {Function} task
   * @return {!Promise}
   */
  postTask(task) {
    const result = this._chain.then(task);
    this._chain = result.catch(() => {});
    return result;
  }
}

module.exports = {TaskQueue};