Infinityc.RequestManager¶
- Subclasses:
None
Methods¶
- Inherited:
- Structs:
class |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Virtual Methods¶
- Inherited:
|
|
|
Properties¶
Name |
Type |
Flags |
Short Description |
|---|---|---|---|
r/w/co |
The local sequence identifier |
Signals¶
- Inherited:
Name |
Short Description |
|---|---|
This signal is emitted whenever a request was added to the request manager. |
|
This signal is emitted whenever a request was removed from the request manager. |
Fields¶
- Inherited:
Name |
Type |
Access |
Description |
|---|---|---|---|
parent |
r |
Class Details¶
- class Infinityc.RequestManager(**kwargs)¶
- Bases:
- Abstract:
No
- Structure:
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:
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.
- 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.
- 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.
- 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.
- 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:
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 returnsNoneand error is set.
- 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.
- remove_request(request)¶
- Parameters:
request (
Infinityc.Request) – AInfinityc.Requestthat has previously been added to self.
Removes a request from the request manager.
- do_request_add(request) virtual¶
- Parameters:
request (
Infinityc.Request) –
Default signal handler for the
Infinityc.RequestManager::request-addsignal.
- do_request_remove(request) virtual¶
- Parameters:
request (
Infinityc.Request) –
Default signal handler for the
Infinityc.RequestManager::request-removesignal.
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 signalrequest (
Infinityc.Request) – TheInfinityc.Requestthat was added.
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:
- Parameters:
request_manager (
Infinityc.RequestManager) – The object which received the signalrequest (
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.
Property Details¶
- Infinityc.RequestManager.props.sequence_id¶
- Name:
sequence-id- Type:
- Default Value:
0- Flags:
The local sequence identifier