Helix Core is now P4. Product user interfaces will be updated soon. Learn more >>

P4 API for Ruby Documentation | 2025.2

# Class P4::Progress

## Description

The `P4::Progress` class is a handler class that provides access to progress indicators from the server. After defining the output handler, set `P4#progress()` to an instance of a subclass of `P4::Progress` (or use a `p4.with_progress( progress )` block) to enable callbacks.

You must implement all five of the following methods: `init()`, `description()`, `update()`, `total()`, and `done()`, even if the implementation consists of trivially returning `0`.

## Class Methods

### new P4::MyProgress.new -> aP4::Progress

Constructs a new subclass of `P4::Progress`.

## Instance Methods

### init -> int

Initialize progress indicator.

### description -> int

Description and type of units to be used for progress reporting.

### update -> int

If non-zero, user has requested a cancellation of the operation.

### total -> int

Total number of units expected (if known).

### done -> int

If non-zero, operation has failed.

## Progress Units

Progress Unit Type | Value
--- | ---
Unspecified | `0`
Percentage Complete | `1`
Number of files | `2`
KB (1024 bytes) | `3`
MB (1024*1024 bytes) | `4`
Number of deltas | `5`

## Progress Types

The following `ProgressTypes` can be reported:

Type | Value | Meaning
--- | --- | ---
`SendFile` | `1` | Files sent to the server. This represents the source path, that is, the local path to the file being sent.
`ReceiveFile` | `2` | Files received from server. This represents the destination path, that is, the local path to the file being received.
`FilesTransferring` | `3` | Files transmitted.
`Computation` | `4` | Computation performed server-side.

For more information on progress indicators from the server see the ClientProgress documentation.

Your search for returned results