Infinity.Request

g GObject.GInterface GObject.GInterface Infinity.Request Infinity.Request GObject.GInterface->Infinity.Request

Implementations:
 None

Methods

class error_quark ()
class strerror (code)
  fail (error)
  finish (result)
  is_local ()

Virtual Methods

  do_finished (result, error)
  do_is_local ()

Properties

Name Type Flags Short Description
progress float r Percentage of completion of the request
type str r/w/co A string identifier for the type of the request

Signals

Name Short Description
finished This signal is emitted when the request finishes.

Fields

None

Class Details

class Infinity.Request
Bases:GObject.GInterface
Structure:Infinity.RequestInterface

Infinity.Request is an opaque data type. You should only access it via the public API functions.

classmethod error_quark()
Returns:A GQuark.
Return type:int

Error domain for request errors. Errors in this domain will be from the Infinity.RequestError enumeration. See GLib.Error for information on error domains.

classmethod strerror(code)
Parameters:code (Infinity.RequestError) – An error code from the Infinity.RequestError enumeration.
Returns:A static string that must not be freed.
Return type:str

Returns a human-readable string for the given error code.

fail(error)
Parameters:error (GLib.Error) – A GLib.Error describing the reason for why the request failed.

Declares the request as failed by emitting the Infinity.Request ::finished signal with the given error.

finish(result)
Parameters:result (Infinity.RequestResult) – A Infinity.RequestResult containing the result of the request.

Declares the request as succeeded by emitting the Infinity.Request ::finished signal with the given result. The function takes ownership of result.

is_local()
Returns:True if the request is local and False if it is remote.
Return type:bool

Returns whether self is local or remote. A local request was triggered by a local API call, whereas a remote request was caused by a remote participant from the network.

do_finished(result, error) virtual
Parameters:
do_is_local() virtual
Returns:True if the request is local and False if it is remote.
Return type:bool

Returns whether request is local or remote. A local request was triggered by a local API call, whereas a remote request was caused by a remote participant from the network.

Signal Details

Infinity.Request.signals.finished(request, result, error)
Signal Name:

finished

Flags:

RUN_LAST

Parameters:

This signal is emitted when the request finishes. If error is non-None the request failed, otherwise it finished successfully.

Property Details

Infinity.Request.props.progress
Name:progress
Type:float
Default Value:0.0
Flags:READABLE

Percentage of completion of the request

Infinity.Request.props.type
Name:type
Type:str
Default Value:None
Flags:READABLE, WRITABLE, CONSTRUCT_ONLY

A string identifier for the type of the request