Infinityc.RequestManager

g GObject.Object GObject.Object Infinityc.RequestManager Infinityc.RequestManager GObject.Object->Infinityc.RequestManager

Subclasses:

None

Methods

Inherited:

GObject.Object (37)

Structs:

GObject.ObjectClass (5)

class

new (seq_id)

clear ()

fail_request (request, error)

finish_request (request, result)

foreach_named_request (name, func, *user_data)

foreach_request (func, *user_data)

get_request_by_seq (seq)

get_request_by_xml (name, xml)

get_request_by_xml_required (name, xml)

remove_request (request)

Virtual Methods

Inherited:

GObject.Object (7)

do_request_add (request)

do_request_remove (request)

Properties

Name

Type

Flags

Short Description

sequence-id

int

r/w/co

The local sequence identifier

Signals

Inherited:

GObject.Object (1)

Name

Short Description

request-add

This signal is emitted whenever a request was added to the request manager.

request-remove

This signal is emitted whenever a request was removed from the request manager.

Fields

Inherited:

GObject.Object (1)

Name

Type

Access

Description

parent

GObject.Object

r

Class Details

class Infinityc.RequestManager(**kwargs)
Bases:

GObject.Object

Abstract:

No

Structure:

Infinityc.RequestManagerClass

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

classmethod new(seq_id)
Parameters:

seq_id (int) – The local sequence ID.

Returns:

A newly allocated Infinityc.RequestManager.

Return type:

Infinityc.RequestManager

Creates a new Infinityc.RequestManager.

clear()

Removes all the requests in self.

fail_request(request, error)
Parameters:

Marks request as failed using Infinity.Request.fail() and then removes the request from the manager.

finish_request(request, result)
Parameters:

Marks request as finished using Infinity.Request.finish() and then removes the request from the manager. The function takes ownership of result.

foreach_named_request(name, func, *user_data)
Parameters:

Calls the given function for each request that has been added to the request manager that has the name name.

foreach_request(func, *user_data)
Parameters:

Calls the given function for each request that has been added to the request manager.

get_request_by_seq(seq)
Parameters:

seq (int) – The sequence number to which the request should be retrieved.

Returns:

The request with the given seq, or None if there is no such request.

Return type:

Infinityc.Request or None

Returns a previously-added request that has the given seq.

get_request_by_xml(name, xml)
Parameters:
  • name (str) – Name of the expected request. May be None to allow all requests.

  • xml (libxml2.NodePtr) – XML node that is supposed to contain a “seq” attribute.

Raises:

GLib.Error

Returns:

The resulting request, or None if the “seq” attribute was not present or an error occurred.

Return type:

Infinityc.Request or None

Looks whether there is a “seq” attribute in xml. If not, the function returns None (without setting error). Otherwise, it returns the request with the given seq and name, if the sequence ID matches. If the “seq” attribute is set but the actual request is not present (or has another name), the function returns None and error is set.

get_request_by_xml_required(name, xml)
Parameters:
  • name (str) – Name of the expected request. May be None to allow all requests.

  • xml (libxml2.NodePtr) – XML node that is supposed to contain a “seq” attribute.

Raises:

GLib.Error

Returns:

The resulting request, or None if an error occurred.

Return type:

Infinityc.Request

Looks whether there is a “seq” attribute in xml. If so, it returns the request with the given seq and name, if the sequence ID matches. If the “seq” attribute is not set or the actual request is not present (or has another name), the function returns None and error is set.

remove_request(request)
Parameters:

request (Infinityc.Request) – A Infinityc.Request that has previously been added to self.

Removes a request from the request manager.

do_request_add(request) virtual
Parameters:

request (Infinityc.Request) –

do_request_remove(request) virtual
Parameters:

request (Infinityc.Request) –

Signal Details

Infinityc.RequestManager.signals.request_add(request_manager, request)
Signal Name:

request-add

Flags:

RUN_LAST

Parameters:

This signal is emitted whenever a request was added to the request manager.

Infinityc.RequestManager.signals.request_remove(request_manager, request)
Signal Name:

request-remove

Flags:

RUN_LAST

Parameters:

This signal is emitted whenever a request was removed from the request manager. Typically this happens when the request has finished (either successfully or unsuccessfully). It can also happen when the client is disconnected from the server while a request was still pending.

Property Details

Infinityc.RequestManager.props.sequence_id
Name:

sequence-id

Type:

int

Default Value:

0

Flags:

READABLE, WRITABLE, CONSTRUCT_ONLY

The local sequence identifier