Interface BulkProgress
Callbacks arrive on whichever pool thread the entry finished on, so a host that draws from them marshals onto its own thread first.
Reported per entry rather than as a percentage on purpose: a bar tells a user how long to wait, while the thing they actually need to know is which alt failed and why.
A RuntimeException a callback throws is ignored by the run: completed(int, int, BulkEntryResult) and
finished(BulkReport) failing changes nothing (the entry stays recorded, the report still completes), and
started(int, int, String) failing only fails the entry it announced, as that method says. An Error a
callback throws cuts the run short instead: the entry being reported keeps its result, and every
remaining entry is reported as AltsFailure.Kind.CANCELLED.
- Since:
- 0.9.0
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final BulkProgressA progress sink that discards everything, for a caller that only wants the report. -
Method Summary
Modifier and TypeMethodDescriptionvoidcompleted(int index, int total, BulkEntryResult result) Called as an entry finishes, whether it succeeded or not.default voidfinished(BulkReport report) Called once when the run is over, however it ended, and beforeBulkHandle.report()completes: a caller woken by the report has already had this call, and every call before it.voidCalled as an entry begins.
-
Field Details
-
NONE
A progress sink that discards everything, for a caller that only wants the report.- Since:
- 0.9.0
-
-
Method Details
-
started
Called as an entry begins.If this throws, that entry is not attempted: it fails with kind
AltsFailure.Kind.UNKNOWN, and the run goes on with the next entry.- Parameters:
index- the entry's position, counting from 0total- how many entries the run was givenlabel- a name safe to display, never the input line- Since:
- 0.9.0
-
completed
Called as an entry finishes, whether it succeeded or not.- Parameters:
index- the entry's position, counting from 0total- how many entries the run was givenresult- what became of it- Since:
- 0.9.0
-
finished
Called once when the run is over, however it ended, and beforeBulkHandle.report()completes: a caller woken by the report has already had this call, and every call before it.- Parameters:
report- what the run came to- Since:
- 0.9.0
-