Hacker News new | ask | show | jobs
by train_robber 3243 days ago
In the older syntax, something like this:

  client.startAsync(new Consumer<TorrentSessionState> {
	void accept(TorrentSessionState state) {
		if (state.getPiecesRemaining() == 0) { 
			client.stop(); 
		}
	}
  }, 1000).join();
1 comments

Thank you. Really useful.