How to use the monster.parallel function in monster

To help you get started, we’ve selected a few monster examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github 2600hz / monster-ui / apps / voip / submodules / users / users.js View on Github external
self.usersListConferences(userId, function(conferences) {
							var listRequests = [];

							_.each(conferences, function(conference) {
								listRequests.push(function(subCallback) {
									self.usersDeleteConference(conference.id, function(data) {
										subCallback(null, data);
									});
								});
							});

							monster.parallel(listRequests, function(err, results) {
								callback && callback(results);
							});
						});
					},
github 2600hz / monster-ui / js / lib / monster.apps.js View on Github external
loadDependencies: function(app, globalCallback) {
			var self = this,
				listRequests = {},
				externalPath = app.appPath + '/external/',
				deps = app.externalScripts || [];

			if(deps.length > 0) {
				_.each(deps, function(name) {
					listRequests[name] = function(callback) {
						monster.getScript(externalPath + name + '.js', function() {
							callback(null, {});
						});
					}
				});

				monster.parallel(listRequests, function(err, results) {
					globalCallback && globalCallback();
				});
			}
			else {
				globalCallback && globalCallback();
			}
		},
github 2600hz / monster-ui / apps / voip / submodules / strategy / strategy.js View on Github external
if('pattern' in featureCode) {
							callflow.patterns = [ featureCode.pattern ];
						}
						else {
							callflow.numbers = [ featureCode.callflowNumber ];
						}

						listRequests.push(function(localCallback) {
							self.strategyCreateCallflow(callflow, function(data) {
								localCallback && localCallback(null, data);
							});
						});
					});

					monster.parallel(listRequests, function(err, results) {
						callback && callback();
					});
				}
			});
		},
github 2600hz / monster-ui-voip / submodules / users / users.js View on Github external
_.each(conferences, function(conference) {
				listRequests.push(function(subCallback) {
					if (forceDelete) {
						self.usersDeleteConference(conference.id, function(data) {
							subCallback(null, data);
						});
					} else {
						self.usersUnassignConference(conference.id, function(data) {
							subCallback(null, data);
						});
					}
				});
			});

			monster.parallel(listRequests, function(err, results) {
				callback && callback(results);
			});
		},
github 2600hz / monster-ui-voip / submodules / strategy / strategy.js View on Github external
function(featureCodes, callback) {
					monster.parallel(
						_.chain(featureCodes)
						.filter(function(featureCode) {
							return !_.includes(
								_.get(featureCode, 'patterns', []),
								_.get(expectedFeaturedCodes, [featureCode.featurecode.name, 'pattern'])
							) && _.includes(featureCodesToUpdate, featureCode.featurecode.name);
						})
						.map(function(featureCode) {
							return function(parallelCallback) {
								self.strategyPatchCallflow({
									data: {
										callflowId: featureCode.id,
										data: {
											patterns: [_.get(expectedFeaturedCodes, [featureCode.featurecode.name, 'pattern'])],
											numbers: []
										}

monster

Flying Spaghetti Machine/Finite State Monster

MIT
Latest version published 12 years ago

Package Health Score

42 / 100
Full package analysis

Popular monster functions