@Override
	public void run() {
		int count = 0;
		while (true) {
			if (!queue.isEmpty()) {
				String line = queue.poll();
				try {
					exec(line);
					if (++count % 1000 == 0) {
						writer.flush();
					}
				} catch (ClientProtocolException e) {
					e.printStackTrace();
				} catch (IOException e) {
					e.printStackTrace();
				}
			} else {
				try {
					sleep(10);
				} catch (InterruptedException e) {
					e.printStackTrace();
				}
			}
		}
	}