lib/emitter.js
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);
			}
		}
	}
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);
			}
		}
	}
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 ) ; } } }
Send all events queued in the buffer to the collector
Send all events queued in the buffer to the collector