atomize-server
Advanced tools
Comparing version 0.0.8 to 0.0.9
@@ -281,2 +281,9 @@ /*global require, exports */ | ||
recordTVarUnpopulated: function (localTVarId, globalTVar) { | ||
var entry = this.localGlobal[localTVarId]; | ||
entry.version = 0; | ||
entry.txnSet = globalTVar.lastTxnSet; | ||
return entry; | ||
}, | ||
localTVarVersion: function (localTVarId) { | ||
@@ -473,4 +480,4 @@ return this.localGlobal[localTVarId].version; | ||
globalIds = Object.keys(updates), | ||
unpopulateds = {}, | ||
txnLog = {type: "updates", updates: {}}, | ||
dependencies = {}, | ||
globalId, globalTVar, localId, localTVar, txnSet, | ||
@@ -514,3 +521,3 @@ globalIds1, globalId1, localId1, names, name, i, desc; | ||
localId1 = this.toLocalTVarID(globalId1); | ||
if (undefined === localId1 || | ||
if (undefined !== localId1 && | ||
this.localTVarVersion(localId1) < txnSet.dependencies[globalId1]) { | ||
@@ -525,25 +532,33 @@ globalIds.push(globalId1); | ||
this.recordTVarVersion(localId, globalTVar); | ||
if (util.hasOwnProp.call(unpopulateds, globalId)) { | ||
localTVar.version = 0; | ||
this.recordTVarUnpopulated(localId, globalTVar); | ||
} else { | ||
this.recordTVarVersion(localId, globalTVar); | ||
// Expand based on the object's fields | ||
names = Object.getOwnPropertyNames(globalTVar.raw); | ||
for (i = 0; i < names.length; i += 1) { | ||
name = names[i]; | ||
desc = Object.getOwnPropertyDescriptor(globalTVar.raw, name); | ||
if (util.hasOwnProp.call(desc.value, 'tvar')) { | ||
localTVar.value[name] = desc; | ||
localId1 = this.toLocalTVarID(desc.value.tvar); | ||
if (undefined === localId1) { | ||
globalIds.push(desc.value.tvar); | ||
desc.tvar = this.addToMapping(desc.value.tvar); | ||
// Expand based on the object's fields | ||
names = Object.getOwnPropertyNames(globalTVar.raw); | ||
for (i = 0; i < names.length; i += 1) { | ||
name = names[i]; | ||
desc = Object.getOwnPropertyDescriptor(globalTVar.raw, name); | ||
if (util.hasOwnProp.call(desc.value, 'tvar')) { | ||
localTVar.value[name] = desc; | ||
localId1 = this.toLocalTVarID(desc.value.tvar); | ||
if (undefined === localId1) { | ||
if (! util.hasOwnProp.call(updates, desc.value.tvar)) { | ||
unpopulateds[desc.value.tvar] = true; | ||
globalIds.push(desc.value.tvar); | ||
} | ||
desc.tvar = this.addToMapping(desc.value.tvar); | ||
} else { | ||
desc.tvar = localId1; | ||
} | ||
// we are sending this tvar. So we can happily | ||
// ensure that no other txnSet can ask us to | ||
// send it | ||
updates[desc.value.tvar] = true; | ||
delete desc.value; | ||
} else { | ||
desc.tvar = localId1; | ||
localTVar.value[name] = desc; | ||
} | ||
// we are sending this tvar. So we can happily | ||
// ensure that no other txnSet can ask us to | ||
// send it | ||
updates[desc.value.tvar] = true; | ||
delete desc.value; | ||
} else { | ||
localTVar.value[name] = desc; | ||
} | ||
@@ -595,3 +610,2 @@ } | ||
globalTVars[rootTVar.id] = rootTVar; | ||
rootTVar.bump(); // Need 2 bumps to ensure we're ahead of any clients. | ||
rootTVar.bump(); | ||
@@ -598,0 +612,0 @@ |
{ | ||
"name": "atomize-server", | ||
"author": "Matthew Sackman", | ||
"version": "0.0.8", | ||
"version": "0.0.9", | ||
"repository": { | ||
@@ -13,6 +13,10 @@ "type": "git", | ||
"cereal": ">=0.0.7", | ||
"atomize-client": ">=0.0.10", | ||
"atomize-client": ">=0.0.12", | ||
"sockjs": ">=0.1.0" | ||
}, | ||
"homepage": "http://atomizejs.github.com/" | ||
"homepage": "http://atomizejs.github.com/", | ||
"keywords": ["software transactional memory", "stm", | ||
"distribution", "synchronisation", "synchronization", | ||
"rpc", "remote procedure call" | ||
] | ||
} |
25987
537
Updatedatomize-client@>=0.0.12