-
Notifications
You must be signed in to change notification settings - Fork 39
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
Add E.get(x) documentation #431
Comments
My basic pizza example is started here. |
Couldn't help but read a little further (though Michael mentioned he's catch me up soon, probably tomorrow). Found the relevant file: E.G = o => makeEGetterProxy(o);
E.H = o => makeEHasProxy(o);
E.D = o => makeEDeleterProxy(o);
E.S = o => makeESetterProxy(o);
E.M = o => makeEMethodProxy(o);
E.C = EChain; Reading the implementation of These are all internal methods for Those are then converted to internal handle calls, which is I guess where the pipelining would really need to come into play? It seems like handle needs to be keeping a message queue per |
You got it! Just one thing: the
|
So the main things I need to document:
const p1 = E.G(E(E(y).method(arg)).method2(arg2)).prop;
// is equivalent to:
const p2 = E.C(y)
.M.method(arg)
.M.method2(arg2)
.G.prop
.P;
// and is read:
// Eventual Chain of `y`,
// to Method call "method(arg)",
// to Method call "method2(arg2)",
// to Get "prop",
// to Promise
|
Be careful how you make the analogy to Promise.resolve(x).then(t => t.method(args)) instead. Likewise for the others. |
Note that this is a breaking API change: * the return value of `m.serialize` is now `{body, slots}` instead of `{argsString, slots}` * `m.unserialize` now takes `(capdata, cyclePolicy)` instead of `(body, slots, cyclePolicy)`. (`cyclePolicy` remains optional) fixes #8
As of 2021-2-18, per Michael only E(x) and E.G(x) are still implemented. So this is changed/reduced to adding something about E.G(x) to the section in distributed-programming about E(x). |
As of 2021-22-02, this is under discussion in agoric-sdk issue #2502. Work on this pending decisions made there. |
Final decision is to add E.get(x), formerly E.G(x) only. |
That sounds like a very easy to interpret alias! |
I suspect this bug is no longer relevant, but I need to ping one of the commenters above to make sure. |
We now have reference docs for E.get() . It's not integrated with docs.agoric.com yet, though. |
This module is full of one-letter methods, and combined with no docs, it is very hard to dive into.
I may document this as I go, because I'm gradually chipping in, but opening an issue in case someone wants to quickly type up an answer key before I have to deduce it from source.
Some mysterious letters that I'm trying to decode:
E()
itself, which I think basically just lines up methods on the eventual result, but potentially remotely, using some messaging format?E.C(presence)
E.C(presence).G
E.C(presence.G[objectKey].M[methodName]
E.C(presence).G[promiseKey].P
I'm also unclear to what degree pipelining works now. This issue suggests it is not added yet, but some aspect of it was merged soon after.
Some notes on how I'm testing capTP
As a very simple test, I'm experimenting whether I can send a message that says to a
pizzeria
presence "whatIsLargestPizzaSize().then(orderPizzaBySize)". This should be doable with a single round trip, and so that is my basic benchmark for the feature.More realistically, I would want to ask
pizzeria.getSizeList().then(pickLargestOption).then(orderPizza)
, wherepickLargestOption
could be a user-specified algorithm, which might require the.there()
call that Mark described to me.Anyways, once I get a deeper understanding here, I may contribute some of these features here instead of at capnode, if I can just get the developer ergonomics up to where I'd feel comfortable promoting them.
The text was updated successfully, but these errors were encountered: