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

feat: refactor ProcessPromise internal state markers #967

Open
antongolub opened this issue Dec 14, 2024 · 2 comments
Open

feat: refactor ProcessPromise internal state markers #967

antongolub opened this issue Dec 14, 2024 · 2 comments
Assignees
Labels
ossln24 OSS Library Night 2024

Comments

@antongolub
Copy link
Collaborator

antongolub commented Dec 14, 2024

We use several private fields to describe the process stage, but we'd like introduce explicit state machine contract

Expose this

_halted
_piped
_output // which means that is fulfilled

via smth like

type ProcessStage = 'halted' | 'pending' | 'fulfilled' | 'rejected'

stage(): ProcessStage {
  if (this._halted) { return ... }
  // ...
}
@antongolub antongolub added the ossln24 OSS Library Night 2024 label Dec 14, 2024
@easymikey
Copy link
Contributor

easymikey commented Dec 18, 2024

I'm ready to implement

@easymikey
Copy link
Contributor

easymikey commented Dec 20, 2024

@antongolub, is it supposed to get state from the outside?
And a few more question:

  1. Is _run state equal to fullfilled?
  2. Are functions like isHulted still needed?
  3. Are field like '_piped`, '_output' and other still needed or cat _state field replace it?
  4. Why don't use #run instead of private _output ?

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

No branches or pull requests

2 participants