Skip to main content

PushProgressFn

Type Alias PushProgressFn 

Source
pub type PushProgressFn = Arc<dyn Fn(&PushProgressSnapshot) + Send + Sync>;
Expand description

A hook that receives the counters of a PushProgress at the start of a scan and when they change.

The hook gets a call at each call of start_phase, also when the phase does not change. A tree scan and Repo::push_to_bucket make this call. The hook also gets a call at a change that a progress display shows. Hook calls lists these calls.

The hook runs on the task that causes the hook call: the task of a session or of a one-way export with export_stream, the task of the scan of a tree push, the task of a push to a bucket repository, or the task of a client that calls set_phase, start_phase, object_uploaded, or add_content. Over HTTP, each parallel object stream of a session calls the hook, so more than one thread can call it at the same time. The session waits for the hook, so the hook must return soon.

A hook that keeps state between calls holds that state behind interior mutability of its own, for example an atomic or a mutex.

Aliased Typeยง

pub struct PushProgressFn { /* private fields */ }