Skip to content

Commit 68337ab

Browse files
committed
DONE FROM MODEL READYgit add test/algo2/assembler/assembler.js
1 parent 4629e1e commit 68337ab

File tree

3 files changed

+8
-11
lines changed

3 files changed

+8
-11
lines changed

lib/context/trioContext.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,11 @@ var layer = function(){
2020

2121
var creatDBContext = function (){
2222
dbCtxt = {};
23+
2324
dbCtxt.divide = app.dividerWrapper.pile.run;
2425
dbCtxt.isDividerDone =app.dividerWrapper.isDone;
2526
dbCtxt.sendToAssembler = app.assemblerWrapper.giveResult;
26-
dbCtxt.sendDoneToAssemblerWrapper = app.assemblerWrapper.assembler.finalResult;
27+
dbCtxt.sendDoneToAssemblerWrapper = app.assemblerWrapper.callFinalResult;
2728
};
2829

2930

lib/db/yaeldb.js

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ var yael = function(){
9999
that.client[send]["RANDOMKEY"](function (err, reply){
100100
if(reply === null){
101101
that.dbutil.consumeCallBacks(yaelDBCallback);
102-
that.sendDoneToAssemblerWrapper();
102+
that.dbContext.sendDoneToAssemblerWrapper();
103103
}
104104
});
105105
}
@@ -124,6 +124,7 @@ var yael = function(){
124124

125125
var times = 0;
126126
that.getASlice = function(cb){
127+
console.log("in getASlice");
127128
that.client[freshID]["RANDOMKEY"](function (err, reply){
128129
if (reply === null){
129130
console.log("got null from db");
@@ -137,7 +138,8 @@ var yael = function(){
137138
}else{
138139
that.dbutil.consumeCallBacks(yaelDBCallback);
139140
times=0;
140-
that.sendDoneToAssemblerWrapper();
141+
console.log("in getASlice befire sendDoneToAssemblerWrapper");
142+
that.dbContext.sendDoneToAssemblerWrapper();
141143
cb(null);
142144
}
143145
}else{
@@ -185,12 +187,7 @@ var yael = function(){
185187
that.flushDB = function(){
186188
var send = sendID;
187189
var fresh = freshID;
188-
that.client[send].send_command("FLUSHDB",function (err,reply){
189-
console.log("reply on flashDB: " +reply );
190-
});
191-
that.client[fresh].send_command("FLUSHDB",function (err,reply){
192-
console.log("reply on flashDB: " +reply );
193-
});
190+
194191
};
195192
that.takeSliceZero = function (sliceFromToDivider){
196193
that.SliceZero = sliceFromToDivider;

test/algo2/assembler/assembler.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ var assembler = function (){
1919
writer.write(+view[i]+",");
2020
console.log("Prime number: "+view[i]);
2121
}
22-
2322
}
2423
};
2524

@@ -28,7 +27,7 @@ var assembler = function (){
2827
// when do call finalResultCB from msg box.
2928
that.finalResult = function(){
3029
console.log("Assembler is Done");
31-
that.AssemMessageBox.finalResultCB("./result.txt");
30+
that.AssemMessageBox.finalResultCB("../../data/result.txt");
3231
};
3332

3433
// confirems to the AssemMessageBox interface

0 commit comments

Comments
 (0)