Add progress_fn argument to MultiWorker.next
commit4b46fdda5a0522abba04ad21491bbf07133ade95
authorGabe Levi <gabe@fb.com>
Sun, 5 Nov 2017 00:45:47 +0000 (4 17:45 -0700)
committerHhvm Bot <hhvm-bot@users.noreply.github.com>
Sun, 5 Nov 2017 01:02:17 +0000 (4 18:02 -0700)
tree991c31c5afae4620634c15d6df2b7ebf72fc9ac1
parent649b96ef8bb7c88a006ab3d8463b5d73944c7698
Add progress_fn argument to MultiWorker.next

Summary:
Adds an optional argument progress_fn to `MultiWorker.next`. Every
time `next ()` is called, `progress_fn ~start ~length ~total` will be called,
where `total` is the total number of items, and `next()` just returned `start`
to `start + length`.

Flow is adding the ability to stream its current status, and its useful to be
able to see the current status of a `Multiworker` job.

Reviewed By: samwgoldman

Differential Revision: D6210087

fbshipit-source-id: 89803ff03cc96e2fc69946920d3882b76bf08136
hphp/hack/src/procs/bucket.ml
hphp/hack/src/procs/bucket.mli
hphp/hack/src/procs/multiWorker.ml
hphp/hack/src/procs/multiWorker.mli