public boolean isEmpty() { return later == null && // No later using our bins in.isEmpty() && // No data meter.isEmpty(); // No responsibility to do more }
public void start() { if (closed()) return; if (!meter.isDone() && later == null && in.hasData()) later = new UploadTask(update, socket, meter.remain(), in); }
/** Make an UploadValve that will upload data into socket. */ public UploadValve(Update update, Socket socket, Range range) { this.update = update; this.socket = socket; meter = new Meter(range); in = Bin.medium(); }