<commit_before>var url = require("url");
var http = require("http");
var ideal = require("ideal");
var oden = module.parent.exports;

oden.HttpClientRequest = ideal.Observable.clone().newSlots({
	type: "oden.HttpClientRequest",
	
	url: null,
	method: "GET",
	
	error: null,
	response: null
}).setSlots({
	init: function()
	{
		ideal.Observable.init.call(this);
		this.setUrl(oden.Url.clone());
	},
	
	start: function()
	{
		var self = this;
		var url = this.url();
		var nodeRequest = http.request({
			host: url.host(),
			port: url.port(),
			method: this.method(),
			path: url.resource()
		}, function(response){
			self.receivedResponse(response);
		});
		
		nodeRequest.on('error', function(e){
			self.failed(e);
		});
		
		nodeRequest.end();
		
		return this;
	},
	
	receivedResponse: function(nodeResponse)
	{
		var response = oden.HttpClientResponse.clone().setNodeResponse(nodeResponse);
		response.addObserver(this);
		response.start();
		this.setResponse(response);
		this.sendNotification("receivedResponse");
	},
	
	httpClientResponseEnded: function()
	{
		this.sendNotification("completed");
	},
	
	failed: function(error)
	{
		this.setError(error);
		this.sendNotification("failed");
	}
});

String.prototype.httpGet = function()
{
	return oden.HttpClientRequest.clone().setUrl(this.asUrl()).start();
}<commit_msg>Disable HttpClientRequest pooling for now<commit_after>var url = require("url");
var http = require("http");
var ideal = require("ideal");
var oden = module.parent.exports;

oden.HttpClientRequest = ideal.Observable.clone().newSlots({
	type: "oden.HttpClientRequest",
	
	url: null,
	method: "GET",
	
	error: null,
	response: null
}).setSlots({
	init: function()
	{
		ideal.Observable.init.call(this);
		this.setUrl(oden.Url.clone());
	},
	
	start: function()
	{
		var self = this;
		var url = this.url();
		var nodeRequest = http.request({
			host: url.host(),
			port: url.port(),
			method: this.method(),
			path: url.resource(),
			agent: false
		}, function(response){
			self.receivedResponse(response);
		});
		
		nodeRequest.on('error', function(e){
			self.failed(e);
		});
		
		nodeRequest.end();
		
		return this;
	},
	
	receivedResponse: function(nodeResponse)
	{
		var response = oden.HttpClientResponse.clone().setNodeResponse(nodeResponse);
		response.addObserver(this);
		response.start();
		this.setResponse(response);
		this.sendNotification("receivedResponse");
	},
	
	httpClientResponseEnded: function()
	{
		this.sendNotification("completed");
	},
	
	failed: function(error)
	{
		this.setError(error);
		this.sendNotification("failed");
	}
});

String.prototype.httpGet = function()
{
	return oden.HttpClientRequest.clone().setUrl(this.asUrl()).start();
}
{'fraction_non_alphanumeric': 0.16697451052826007, 'fraction_numerical': 0.0, 'mean_word_length': 4.481781376518219, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1274081', 'n_tokens_mistral': 995, 'n_tokens_neox': 874, 'n_words': 158}