Update mem.js
Showing
1 changed file
with
18 additions
and
0 deletions
... | @@ -29,6 +29,24 @@ | ... | @@ -29,6 +29,24 @@ |
29 | to = setTimeout(flush, opt.wait || 1); | 29 | to = setTimeout(flush, opt.wait || 1); |
30 | }); | 30 | }); |
31 | 31 | ||
32 | ctx.on("put", function(at) { | ||
33 | this.to.next(at); | ||
34 | Gun.graph.is(at.put, null, null); | ||
35 | if (!at["@"]) { | ||
36 | acks[at["#"]] = true; | ||
37 | } // only ack non-acks. | ||
38 | count += 1; | ||
39 | if (count >= (opt.batch || 10000)) { | ||
40 | return flush(); | ||
41 | } | ||
42 | if (to) { | ||
43 | return; | ||
44 | } | ||
45 | to = setTimeout(flush, opt.wait || 1); | ||
46 | var id = at['#'] | ||
47 | ctx.on('in', {"@": id, ok:1}) | ||
48 | }); | ||
49 | |||
32 | ctx.on("get", function(at) { | 50 | ctx.on("get", function(at) { |
33 | // this.to.next(at); //What does this do? | 51 | // this.to.next(at); //What does this do? |
34 | var lex = at.get, | 52 | var lex = at.get, | ... | ... |
-
Please register or sign in to post a comment