RecvClient#
Bases: Container
Messaging receiver.
Source code in pubtools/sign/clients/msg_recv_client.py
160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 |
|
__init__(uid, topic, message_ids, id_key, broker_urls, cert, ca_cert, timeout, retries, errors, received)
#
Recv Client Initializer.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
topic
|
str
|
Topic where to listen for incoming messages |
required |
message_ids
|
List[str]
|
List of awaited message ids |
required |
id_key
|
str
|
Attribute name in message body which is considered as id |
required |
broker_urls
|
List[str]
|
List of broker urls |
required |
cert
|
str
|
Messaging client certificate |
required |
ca_cert
|
str
|
Messaging ca certificate |
required |
timeout
|
int
|
Timeout for the messaging receiver |
required |
retries
|
int
|
How many attempts to retry receiving messages |
required |
errors
|
List[MsgError]
|
List of errors which occured during the process |
required |
received
|
Dict[Any, Any]
|
Mapping of received messages |
required |
uid
|
str
|
Unique identifier for the receiver |
required |
Source code in pubtools/sign/clients/msg_recv_client.py
163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 |
|
close()
#
Close receiver.
Source code in pubtools/sign/clients/msg_recv_client.py
257 258 259 260 261 |
|
get_errors()
#
Get errors from receiver.
This method doesn't have any meaningfull usecase, it's only used for testing
Returns:
Type | Description |
---|---|
List[MsgError]
|
List[MsgError]: List of errors which occured during the process |
Source code in pubtools/sign/clients/msg_recv_client.py
219 220 221 222 223 224 225 226 227 |
|
get_received()
#
Get received messages.
This method doesn't have any meaningfull usecase, it's only used for testing
Returns:
Type | Description |
---|---|
Dict[Any, Any]
|
Dict[Any, Any]: Dictionary of received messages |
Source code in pubtools/sign/clients/msg_recv_client.py
229 230 231 232 233 234 235 236 237 |
|
run()
#
Run the receiver.
This method starts the receiver and waits for messages to be received.
Returns:
Type | Description |
---|---|
Union[Dict[Any, Any], List[MsgError]]
|
Union[Dict[Any, Any], List[MsgError]]: Dictionary of received messages if successful, |
Union[Dict[Any, Any], List[MsgError]]
|
or a list of errors if any occurred. |
Source code in pubtools/sign/clients/msg_recv_client.py
239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 |
|