Skip to content

Commit

Permalink
liveSlots: queueMessage() now returns a Handled Promise
Browse files Browse the repository at this point in the history
This, and default-evaluate-options-0.1.3, should fix Agoric#131, by making
liveSlots tell the kernel about pipelined messages. We won't get actual
pipelining until we add Agoric#88, to enable the kernel to deliver pipelined
messages to the comms vat.
  • Loading branch information
warner committed Sep 6, 2019
1 parent f550afd commit 44cc204
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/kernel/liveSlots.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import harden from '@agoric/harden';
import Nat from '@agoric/nat';
import { QCLASS, mustPassByPresence, makeMarshal } from '@agoric/marshal';
import makePromise from './makePromise';

// 'makeLiveSlots' is a dispatcher which uses javascript Maps to keep track
// of local objects which have been exported. These cannot be persisted
Expand Down Expand Up @@ -199,11 +198,12 @@ function build(syscall, _state, makeRoot, forVatID) {
const m = makeMarshal(serializeSlot, unserializeSlot);

function queueMessage(targetSlot, prop, args) {
const done = makePromise();
const ser = m.serialize(harden({ args }));
lsdebug(`ls.qm send(${JSON.stringify(targetSlot)}, ${prop}`);
const promiseID = syscall.send(targetSlot, prop, ser.argsString, ser.slots);
lsdebug(` ls.qm got promiseID ${promiseID}`);
const slot = { type: 'promise', id: promiseID };
const done = makeQueued(slot);

// prepare for notifyFulfillToData/etc
importedPromisesByPromiseID.set(promiseID, done);
Expand All @@ -215,7 +215,6 @@ function build(syscall, _state, makeRoot, forVatID) {

// prepare the serializer to recognize it, if it's used as an argument or
// return value
const slot = { type: 'promise', id: promiseID };
const key = slotToKey(slot);
valToSlot.set(done.p, slot);
slotKeyToVal.set(key, done.p);
Expand Down

0 comments on commit 44cc204

Please sign in to comment.