Skip to content

Commit b95956e

Browse files
Merge pull request #22 from rik-bos/blockingExecution
Blocking execution
2 parents bab384f + a0e0ca2 commit b95956e

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

src/MicroflowTimer/widget/MicroflowTimer.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ define([
2626
_timeout: null,
2727
_timerStarted: false,
2828

29+
_flowRunning: false,
30+
2931
postCreate: function() {
3032
this._handles = [];
3133

@@ -168,6 +170,12 @@ define([
168170
},
169171

170172
_executeEvent: function() {
173+
if (this._flowRunning === true) {
174+
return;
175+
}
176+
177+
this._flowRunning = true;
178+
171179
if(this.callEvent === "callMicroflow" && this.microflow) {
172180
this._execMf()
173181
} else if (this.callEvent === "callNanoflow" && this.nanoflow.nanoflow){
@@ -195,9 +203,11 @@ define([
195203
logger.debug(this.id + "._execMf callback, stopping timer");
196204
this._stopTimer();
197205
}
206+
this._flowRunning = false;
198207
}),
199208
error: lang.hitch(this, function(error) {
200209
logger.error(this.id + ": An error ocurred while executing microflow: ", error);
210+
this._flowRunning = false;
201211
})
202212
};
203213

@@ -224,9 +234,11 @@ define([
224234
logger.debug(this.id + "._executeNanoFlow callback, stopping timer");
225235
this._stopTimer();
226236
}
237+
this._flowRunning = false;
227238
}),
228239
error: lang.hitch(this, function(error) {
229240
logger.error(this.id + ": An error ocurred while executing nanoflow: ", error);
241+
this._flowRunning = false;
230242
})
231243
});
232244
}

test/widgets/MicroflowTimer.mpk

35 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)