docs: function emitter(endpoint, protocol, port, method, bufferSize, callback, agentOptions) {
  	protocol = (protocol || 'http').toLowerCase();
  	method = (method || 'get').toLowerCase();
  	if (bufferSize === null || typeof bufferSize === 'undefined') {
  		bufferSize = method === 'get' ? 0 : 10;
  	}
  	var portString = port ? ':' + port : '';
  	var path = method === 'get' ? '/i' : '/com.snowplowanalytics.snowplow/tp2';
  	var targetUrl = protocol + '://' + endpoint + portString + path;
  	var buffer = [];
  
  	/**
  	 * Send all events queued in the buffer to the collector
  	 */
  	function flush() {
  		var temp = buffer;
  		buffer = [];
  		if (method === 'post') {
  			var postJson = {
  				schema: 'iglu:com.snowplowanalytics.snowplow/payload_data/jsonschema/1-0-0',
  				data: temp.map(valuesToStrings)
  			};
  			request.post({
  				url: targetUrl,
  				json: postJson,
  				agentOptions: agentOptions,
  				headers: {
  					'content-type': 'application/json; charset=utf-8'
  				}
  			}, callback);
  
  		} else {
  			for (var i=0; i<temp.length; i++) {
  				request.get({
  					url: targetUrl,
                      agentOptions: agentOptions,
  				 	qs: temp[i]
  				}, callback);
  			}
  		}
  	}
  
  	return {
  		flush: flush,
  		input: function (payload) {
  			buffer.push(payload);
  			if (buffer.length >= bufferSize) {
  				flush();
  			}
  		}
  	};
  }