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

xq-promise Terminology vs. JavaScript/jQuery #19

Open
adamretter opened this issue Nov 30, 2018 · 0 comments
Open

xq-promise Terminology vs. JavaScript/jQuery #19

adamretter opened this issue Nov 30, 2018 · 0 comments

Comments

@adamretter
Copy link

Hi @james-jw,

Very cool stuff. I finally found some time to look at this properly in detail and it is a very interesting piece of work.

Having read your paper from XML Prague and tried to understand Promise in the ECMA spec, and Deferred in the jQuery documentation, I am a little confused. I am wondering if the terminology you use in xq-promise is meant to be directly comparable to the ECMA or jQuery? For example do you consider a "Promise" in xq-promise to have the same semantics as a "Promise" in ECMA?

From what I can understand the major difference is the execution model. It is clear to me that in xq-promise a Promise is never executed until it is passed to fork-join or fork. In both EMCA and jQuery it seems that the function passed to either Promise or Deferred is immediately evaluated with the arguments necessary it to complete the promise, although that completion may happen later if the function itself calls other asyncronous functions (e.g. setTimeout).

Also it seems that in xq-promise a promise is completed by the return value of the function passed to promise:deferred being evaluated. Whereas in ECMA and jQuery, the inner function has to call the resolve or failed functions that it is passed as arguments. This is perhaps a subtle difference, but perhaps an important one?

I guess I am confused by how you use the terms executed and execution. If I understand correctly with ECMA and jQuery a Promise may have been "completed" before you compose with it via then to it, but that is okay, the result is still the same.

Just wondering what your thoughts are on this?

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