Enum glean_core::upload::PingUploadTask[][src]

pub enum PingUploadTask {
    Upload(PingRequest),
    Wait(u64),
    Done,
}
Expand description

An enum representing the possible upload tasks to be performed by an uploader.

When asking for the next ping request to upload, the requester may receive one out of three possible tasks.

If new variants are added, this should be reflected in glean-core/ffi/src/upload.rs as well.

Variants

Upload(PingRequest)
Expand description

A PingRequest popped from the front of the queue. See PingRequest for more information.

Wait(u64)
Expand description

A flag signaling that the pending pings directories are not done being processed, thus the requester should wait and come back later.

Contains the amount of time in milliseconds the requester should wait before requesting a new task.

Done
Expand description

A flag signaling that requester doesn’t need to request any more upload tasks at this moment.

There are three possibilities for this scenario:

  • Pending pings queue is empty, no more pings to request;
  • Requester has gotten more than MAX_WAIT_ATTEMPTS (3, by default) PingUploadTask::Wait responses in a row;
  • Requester has reported more than MAX_RECOVERABLE_FAILURES_PER_UPLOADING_WINDOW recoverable upload failures on the same uploading window (see below) and should stop requesting at this moment.

An “uploading window” starts when a requester gets a new PingUploadTask::Upload(PingRequest) response and finishes when they finally get a PingUploadTask::Done or PingUploadTask::Wait response.

Implementations

impl PingUploadTask[src]

pub fn is_upload(&self) -> bool[src]

Whether the current task is an upload task.

pub fn is_wait(&self) -> bool[src]

Whether the current task is wait task.

Trait Implementations

impl Debug for PingUploadTask[src]

fn fmt(&self, f: &mut Formatter<'_>) -> Result[src]

Formats the value using the given formatter. Read more

impl PartialEq<PingUploadTask> for PingUploadTask[src]

fn eq(&self, other: &PingUploadTask) -> bool[src]

This method tests for self and other values to be equal, and is used by ==. Read more

fn ne(&self, other: &PingUploadTask) -> bool[src]

This method tests for !=.

impl StructuralPartialEq for PingUploadTask[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

impl<T> From<T> for T[src]

pub fn from(t: T) -> T[src]

Performs the conversion.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

pub fn into(self) -> U[src]

Performs the conversion.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]

Performs the conversion.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]

Performs the conversion.