Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix typing issues in engine.ts #114

Open
creadicted opened this issue Sep 7, 2021 · 0 comments
Open

Fix typing issues in engine.ts #114

creadicted opened this issue Sep 7, 2021 · 0 comments

Comments

@creadicted
Copy link
Contributor

In the engine.ts file are two methods - abort() and lock() that lead to errors:

public async abort() {
    return new Promise((ret) => {
      if (this.state === State.PROCESSED) {
        this.state = State.ABORT;
        this.onAbort = ret;
      } else if (this.state === State.ABORT) {
        this.onAbort();
        this.onAbort = ret;
      } else ret();
    });
  }
 private async lock(node: EngineNode) {
    return new Promise((res) => {
      node.unlockPool = node.unlockPool || [];
      if (node.busy && !node.outputData) node.unlockPool.push(res);
      else res();

      node.busy = true;
    });
  }

They both handle the Promise execution in a way that is not familiar to me, so I need to investigate. But I also do not want to forget it - thats the reason why I created this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant