MCPcopy Index your code
hub / github.com/node-js-libs/node.io / handle_input

Function handle_input

lib/node.io/process_master.js:116–146  ·  view source on GitHub ↗
(input)

Source from the content-addressed store, hash-verified

114
115 //Callback for when input is received from job.input()
116 var handle_input = function (input) {
117 if (typeof input !== 'undefined' && input !== null && input !== false) {
118 master.emit('input', input, for_worker);
119 } else {
120
121 //No input? We might be done..
122
123 var isComplete = function () {
124 //Check if any input was added dynamically
125 if (job.input.length > 0) {
126 job.is_complete = false;
127 return false;
128 }
129
130 //Wait for workers or instances that are still working
131 return worker_count > 0 ? areWorkersComplete() : job.instances <= 0;
132 };
133
134 //If we're not complete, check periodically
135 if (isComplete()) {
136 master.emit('complete');
137 } else {
138 completeCheckInterval = setInterval(function () {
139 if (isComplete()) {
140 clearInterval(completeCheckInterval);
141 master.emit('complete');
142 }
143 }, 300);
144 }
145 }
146 };
147
148 if (pull > 0) {
149

Callers 1

process_master.jsFile · 0.85

Calls 1

isCompleteFunction · 0.85

Tested by

no test coverage detected