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 when they change.

The hook gets a call only at a change that a progress display shows. Hook calls lists these changes.

The hook runs on the task that changed the counters: the task of the session, or the task of the scan of a tree push. 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 */ }