MCPcopy Index your code
hub / github.com/share/sharedb / commitConcurrent

Function commitConcurrent

test/db.js:90–111  ·  view source on GitHub ↗
(db, ops, test, done)

Source from the content-addressed store, hash-verified

88
89 describe('commit', function() {
90 function commitConcurrent(db, ops, test, done) {
91 var numSucceeded = 0;
92 async.each(ops, function(op, eachCb) {
93 submit(db, 'testcollection', 'foo', op, function(err, succeeded) {
94 if (err) return eachCb(err);
95 if (succeeded) numSucceeded++;
96 eachCb();
97 });
98 }, function(err) {
99 if (err) return done(err);
100 expect(numSucceeded).equal(1);
101 if (!test) return done();
102 db.getOps('testcollection', 'foo', 0, null, null, function(err, opsOut) {
103 if (err) return done(err);
104 db.getSnapshot('testcollection', 'foo', null, null, function(err, snapshotOut) {
105 if (err) return done(err);
106 test(opsOut, snapshotOut);
107 done();
108 });
109 });
110 });
111 }
112
113 function testCreateCommit(ops, snapshot) {
114 expect(snapshot.v).eql(1);

Callers 2

db.jsFile · 0.85
createDocFunction · 0.85

Calls 2

submitFunction · 0.85
testFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…