-
Notifications
You must be signed in to change notification settings - Fork 230
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
feat(vow): a pattern for promises that survive upgrades #8742
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are these all the files needed to create a well-formed package under agoric-sdk? In endo I use https://github.com/endojs/endo/blob/master/scripts/create-package.sh which starts my copying https://github.com/endojs/endo/tree/master/packages/skel
@kriskowal could agoric-sdk use its own copy of create-package.sh
and skel
for this purpose?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Progress, but review far from done.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am finding it hard to review without already knowing concretely how you intend that it be used. There are neither inline comments nor any *.md files. There is the PR comment, which is certainly a great start!
I'll keep going on this review pass for awhile. But if I cannot figure it out despite my existing orientation, may others won't as well, until there is more explanatory text.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, I think I'm done enough for this pass. Will do another once I understand better.
import { makeTagged } from '@endo/pass-style'; | ||
import { prepareVowTools } from '../src/tools.js'; | ||
|
||
test('retry on disconnection', async t => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah... this looks like it demonstrates how to use the API
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we need something that can go through endo interface guards.
b4f6a14
to
4e77193
Compare
4e77193
to
ecbc34d
Compare
ecbc34d
to
4d9371c
Compare
Closes: #8906
Description
Vows are a kind of "pseudo-promise" in that they are ocaps that can be made durable, and don't have a
.then
method so they won't be adopted by the platform Promise implementation.The
@agoric/vow
module provides:when(specimen): Promise<T>
operator for returning a promise for the fulfilment of a specimen, including unwrapping any intermediate Vows. This operator is not durable-compatible.watch(specimen, { onFulfilled, onRejected }): Vow<T>
operator that registers possibly durable fulfilment and rejection handlers, and returns a durable Vow for the result of calling those handlers.makeVowKit(): { whenable, resolver: { resolve, reject } }
Security Considerations
Scaling Considerations
Documentation Considerations
Testing Considerations
Upgrade Considerations