Comment

Comment by train_robber

In the older syntax, something like this:

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

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton