saturnin.component.client¶
Saturnin base module for implementation of Firebird Butler Service clients
Classes¶
- class saturnin.component.client.Token(value: int = 0)[source]¶
Bases:
object
FBSP message token generator.
- Parameters:
value (int) –
- class saturnin.component.client.ServiceClient(timeout: int = 1000)[source]¶
Bases:
object
Base class for Firebird Butler Service clients.
- Parameters:
timeout (int) –
- __init__(timeout: int = 1000)[source]¶
- Parameters:
timeout (int) – The timeout (in milliseconds) to wait for message.
- open(channel: Channel, address: ZMQAddress, agent: AgentDescriptor, peer_uid: UUID) None [source]¶
Open connection to Firebird Butler service.
- Parameters:
channel (Channel) – Channel used for communication with service.
address (ZMQAddress) – Service endpoint address.
agent (AgentDescriptor) – Client agent identification.
peer_uid (UUID) – Client peer ID.
- Return type:
None
- receive() FBSPMessage [source]¶
Receive one message from service.
- Raises:
TimeoutError – When timeout expires.
Error – When
Channel.receive()
returnsINVALID
sentinel, or service closes connection with CLOSE message.
- Return type:
- send(msg: FBSPMessage) None [source]¶
Send message to the service.
- Parameters:
msg (FBSPMessage) – Message to be sent.
- Return type:
None