{"size": 1032, "ext": "js", "max_stars_repo_path": "framework/source/base/services/MockService.js", "max_stars_repo_name": "designsome/enyo-1.0", "max_stars_repo_stars_event_min_datetime": "2015-11-05T03:00:29.000Z", "max_stars_repo_stars_event_max_datetime": "2017-12-16T16:31:36.000Z", "max_issues_repo_path": "framework/source/base/services/MockService.js", "max_issues_repo_name": "designsome/enyo-1.0", "max_issues_repo_issues_event_min_datetime": "2021-02-20T13:01:12.000Z", "max_issues_repo_issues_event_max_datetime": "2022-02-21T15:21:20.000Z", "max_forks_repo_path": "framework/source/base/services/MockService.js", "max_forks_repo_name": "ericblade/enyo-1.0", "max_forks_repo_forks_event_min_datetime": "2015-05-15T17:12:20.000Z", "max_forks_repo_forks_event_max_datetime": "2022-02-27T20:53:34.000Z"}
{"max_stars_count": 6, "max_issues_count": 7, "max_forks_count": 5, "avg_line_length": 20.64, "max_line_length": 85, "alphanum_fraction": 0.6531007752}
enyo.kind({
	name: "enyo.MockService",
	kind: enyo.Service,
	requestKind: "MockService.Request",
	published: {
		method: "",
		subscribe: false
	},
	//* @protected
	importProps: function(inProps) {
		inProps.method = inProps.method || inProps.name;
		this.inherited(arguments);
	},
	//* @public
	//* Call the service
	call: function() {
		return this.request({method: this.method, subscribe: this.subscribe});
	}
});

//* @protected
enyo.kind({
	name: "enyo.MockService.Request",
	kind: enyo.Request,
	destroy: function() {
		this.inherited(arguments);
		clearInterval(this.job);
	},
	_call: function() {
		setTimeout(enyo.bind(this, "receive", this.makeResponse()), enyo.irand(200) + 100);
	},
	call: function() {
		this._call();
		if (this.subscribe) {
			this.job = setInterval(enyo.bind(this, "_call"), 3000);
		}
	},
	makeResponse: function() {
		return enyo.irand(1000) + 1000;
	},
	isFailure: function(inResponse) {
		return inResponse < 1250;
	},
	finish: function() {
		if (!this.subscribe) {
			this.destroy();
		}
	}
});
