Infinity.CommunicationRegistry¶
- Subclasses:
None
Methods¶
- Inherited:
- Structs:
|
|
|
|
|
|
|
|
|
Virtual Methods¶
- Inherited:
Properties¶
None
Signals¶
- Inherited:
Fields¶
- Inherited:
Name |
Type |
Access |
Description |
---|---|---|---|
parent_instance |
r |
Class Details¶
- class Infinity.CommunicationRegistry(**kwargs)¶
- Bases:
- Abstract:
No
- Structure:
Infinity.CommunicationRegistry
is an opaque data type. You should only access it via the public API functions.- cancel_messages(group, connection)¶
- Parameters:
group (
Infinity.CommunicationGroup
) – The group for which to cancel messages.connection (
Infinity.XmlConnection
) – A registeredInfinity.XmlConnection
.
Stops all messages scheduled to be sent to connection in group from being sent.
- is_registered(group, connection)¶
- Parameters:
group (
Infinity.CommunicationGroup
) – The group for which to check whether connection is registered.connection (
Infinity.XmlConnection
) – The connection to check for registration.
- Returns:
- Return type:
Returns whether connection has been registered for group with
Infinity.CommunicationRegistry.register
().
- register(group, method, connection)¶
- Parameters:
group (
Infinity.CommunicationGroup
) – The group for which to register a connection.method (
Infinity.CommunicationMethod
) – TheInfinity.CommunicationMethod
used.connection (
Infinity.XmlConnection
) – The connection to register.
Registers connection with group. This allows sending messages to connection via
Infinity.CommunicationRegistry.send
(). For received messages,Infinity.CommunicationMethod.received
() is called on method.connection must have status
Infinity.XmlConnectionStatus.OPEN
.
- send(group, connection, xml)¶
- Parameters:
group (
Infinity.CommunicationGroup
) – The group for which to send the messageInfinity.CommunicationGroup
.connection (
Infinity.XmlConnection
) – A registeredInfinity.XmlConnection
.xml (
libxml2.NodePtr
) – The message to send.
Sends an XML message to connection. connection must have been registered with
Infinity.CommunicationRegistry.register
() before. If the message has been sent,Infinity.CommunicationMethod.sent
() is called on the method the connection was registered with.Infinity.CommunicationMethod.enqueued
() is called when sending the message can no longer be cancelled viaInfinity.CommunicationRegistry.cancel_messages
().This function takes ownership of xml.
- unregister(group, connection)¶
- Parameters:
group (
Infinity.CommunicationGroup
) – The group for which to unregister a connection.connection (
Infinity.XmlConnection
) – The connection to unregister.
Unregisters connection from group. Incoming messages are no longer reported to group’s method, and
Infinity.CommunicationRegistry.send
() can no longer be called for connection.