private void streaming()
	{
		// Number of milliseconds in sleep.
		long sleep = _configuration.getLongValue(SNConnectorKeys.CONF_SLEEP_KEY.getId(), DEFAULT_SLEEP);
		// Sets how many events must have received to start sending the data.
		int eventsThreshold = _configuration.getIntValue(SNConnectorKeys.CONF_EVENTS_THRESHOLD_KEY.getId(), DEFAULT_THRESHOLD);
		//TODO: Add a condition to end the streaming.
		
		_connector.query(false);
		
		while(true)
		{
			// If there are enough results, send them via client.
			if (_connector.getResultSize() >= eventsThreshold)
			{
				List<SNObject> results = _connector.getAndClearResults();
				for(SNObject event: results)
				{
					_client.sendData(event);
				}
			}
			// Else, sleep the thread.
			else
			{
				try
				{
					sleep(sleep);
				} 
				catch (InterruptedException e) 
				{
					log.info("Exception in wait execution.");
					e.printStackTrace();
				}
			}
		}
	}