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) | 
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. | 
Class Details¶
- 
class Infinityc.RequestManager(**kwargs)¶
- Bases: - GObject.Object- Abstract: - No - Structure: - Infinityc.RequestManagerClass- Infinityc.RequestManageris 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: - request (Infinityc.Request) – AInfinityc.Requestthat has previously been added to self.
- error (GLib.Error) – Error information why the request failed.
 - Marks request as failed using - Infinity.Request.fail() and then removes the request from the manager.
- request (
 - 
finish_request(request, result)¶
- Parameters: - request (Infinityc.Request) – AInfinityc.Requestthat has previously been added to self.
- result (Infinity.RequestResult) – The request result.
 - Marks request as finished using - Infinity.Request.finish() and then removes the request from the manager. The function takes ownership of result.
- request (
 - 
foreach_named_request(name, func, *user_data)¶
- Parameters: - name (str) – The name of the request to look for.
- func (Infinityc.RequestManagerForeachFunc) – The function to be called.
- user_data (objectorNone) – Arbitrary data to be passed to func.
 - Calls the given function for each request that has been added to the request manager that has the name name. 
- name (
 - 
foreach_request(func, *user_data)¶
- Parameters: - func (Infinityc.RequestManagerForeachFunc) – The function to be called.
- user_data (objectorNone) – Arbitrary data to be passed to func.
 - Calls the given function for each request that has been added to the request manager. 
- func (
 - 
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 - Noneif there is no such request.- Return type: - Infinityc.Requestor- 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 beNoneto allow all requests.
- xml (libxml2.NodePtr) – XML node that is supposed to contain a “seq” attribute.
 - Raises: - Returns: - The resulting request, or - Noneif the “seq” attribute was not present or an error occurred.- Return type: - 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- Noneand error is set.
- name (
 - 
get_request_by_xml_required(name, xml)¶
- Parameters: - name (str) – Name of the expected request. May beNoneto allow all requests.
- xml (libxml2.NodePtr) – XML node that is supposed to contain a “seq” attribute.
 - Raises: - Returns: - The resulting request, or - Noneif an error occurred.- Return type: - 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 - Noneand error is set.
- name (
 - 
remove_request(request)¶
- Parameters: - request ( - Infinityc.Request) – A- Infinityc.Requestthat 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) –
 
- 
classmethod 
Signal Details¶
- 
Infinityc.RequestManager.signals.request_add(request_manager, request)¶
- Signal Name: - request-add- Flags: - Parameters: - request_manager (Infinityc.RequestManager) – The object which received the signal
- request (Infinityc.Request) – TheInfinityc.Requestthat was added.
 - This signal is emitted whenever a request was added to the request manager. 
- request_manager (
- 
Infinityc.RequestManager.signals.request_remove(request_manager, request)¶
- Signal Name: - request-remove- Flags: - Parameters: - request_manager (Infinityc.RequestManager) – The object which received the signal
- request (Infinityc.Request) – TheInfinityc.Requestthat was removed.
 - 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. 
- request_manager (