If I try to make a lot of HTTP requests at the same time, interpreter eventually throws a net::ERR_INSUFFICIENT_RESOURCES
error. For example,
'use strict';
require('angular');
const app = angular.module('app', []);
app.controller('MainController', ['$scope', '$http', function($scope, $http) {
$scope.makeRequest = function() {
$http.get('http://example.com').then(
function success(response) {
// ...
}, function error(response) {
// ...
});
};
setInterval(function() {
$scope.makeRequest();
}, 1);
}]);
What kind of "resources" does it mean? Application uses about 150 Mb so I guess it's not related to memory. Does it have some internal "max. requests count" constant then?
How can I handle such situations then?