Worker
Task(input: BaseModel, output: Optional[BaseModel] = None, name: str = None)
¤
Task is a class-based decorator designed to validate the input arguments of a function using a specified Pydantic model. It ensures that the arguments passed to the decorated function conform to the schema defined in the model.
Attributes:
Name | Type | Description |
---|---|---|
model |
BaseModel
|
A Pydantic model used to validate the function arguments. |
name |
str
|
The name of the task, which is used to register the task for calling, by default set equal to the name of decorated function. |
result_model |
BaseModel
|
A Pydantic model used to validate the function's return value. |
Methods:
Name | Description |
---|---|
__call__ |
Callable) -> Callable: Wraps the target function and validates its arguments before execution. |
merge_args_to_kwargs |
List, kwargs: Dict) -> Dict:
Merges positional arguments ( |
validate_input |
List, kwargs: Dict) -> None: Validates merged arguments against Pydantic model. If validation fails, an exception is raised. |
Usage
@Task(model=YourPydanticModel) def your_function(arg1, arg2, ...): # Function implementation pass
Notes
- The decorator uses
inspect.getfullargspec
to analyze the function's signature and properly map arguments for validation.
Source code in norfab\core\worker.py
80 81 82 83 84 85 86 87 88 |
|
merge_args_to_kwargs(args: List, kwargs: Dict) -> Dict
¤
Merges positional arguments (args
) and keyword arguments (kwargs
) into a single dictionary.
This function uses the argument specification of the decorated function to ensure that all arguments are properly combined into a dictionary. This is particularly useful for scenarios where **kwargs need to be passed to another function or model (e.g., for validation purposes).
Parameters:
Name | Type | Description | Default |
---|---|---|---|
args
|
list
|
A list of positional arguments passed to the decorated function. |
required |
kwargs
|
dict
|
A dictionary of keyword arguments passed to the decorated function. |
required |
Return
dict: A dictionary containing the merged arguments, where positional arguments are mapped to their corresponding parameter names.
Source code in norfab\core\worker.py
108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 |
|
validate_input(args: List, kwargs: Dict) -> None
¤
Function to validate provided arguments against model
Source code in norfab\core\worker.py
147 148 149 150 151 152 153 154 |
|
WorkerWatchDog(worker)
¤
Bases: Thread
Class to monitor worker performance.
Attributes:
Name | Type | Description |
---|---|---|
worker |
object
|
The worker instance being monitored. |
worker_process |
Process
|
The process of the worker. |
watchdog_interval |
int
|
Interval in seconds for the watchdog to check the worker's status. |
memory_threshold_mbyte |
int
|
Memory usage threshold in megabytes. |
memory_threshold_action |
str
|
Action to take when memory threshold is exceeded ("log" or "shutdown"). |
runs |
int
|
Counter for the number of times the watchdog has run. |
watchdog_tasks |
list
|
List of additional tasks to run during each watchdog interval. |
Methods:
Name | Description |
---|---|
check_ram |
Checks the worker's RAM usage and takes action if it exceeds the threshold. |
get_ram_usage |
Returns the worker's RAM usage in megabytes. |
run |
Main loop of the watchdog thread, periodically checks the worker's status and runs tasks. |
Parameters:
Name | Type | Description | Default |
---|---|---|---|
worker
|
object
|
The worker object containing inventory attributes. |
required |
Source code in norfab\core\worker.py
184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 |
|
check_ram()
¤
Checks the current RAM usage and performs an action if it exceeds the threshold.
This method retrieves the current RAM usage and compares it to the predefined
memory threshold. If the RAM usage exceeds the threshold, it performs an action
based on the memory_threshold_action
attribute. The possible actions are:
- "log": Logs a warning message.
- "shutdown": Raises a SystemExit exception to terminate the program.
Raises:
Type | Description |
---|---|
SystemExit
|
If the memory usage exceeds the threshold and the action is "shutdown". |
Source code in norfab\core\worker.py
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 |
|
get_ram_usage()
¤
Get the RAM usage of the worker process.
Returns:
Name | Type | Description |
---|---|---|
float |
The RAM usage in megabytes. |
Source code in norfab\core\worker.py
231 232 233 234 235 236 237 238 |
|
run()
¤
Executes the worker's watchdog main loop, periodically running tasks and checking conditions. The method performs the following steps in a loop until the worker's exit event is set:
- Sleeps in increments of 0.1 seconds until the total sleep time reaches the watchdog interval.
- Runs built-in tasks such as checking RAM usage.
- Executes additional tasks provided by child classes.
- Updates the run counter.
- Resets the sleep counter to start the cycle again.
Attributes:
Name | Type | Description |
---|---|---|
slept |
float
|
The total time slept in the current cycle. |
Source code in norfab\core\worker.py
240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 |
|
NFPWorker(inventory: NorFabInventory, broker: str, service: str, name: str, exit_event: object, log_level: str = None, log_queue: object = None, multiplier: int = 6, keepalive: int = 2500)
¤
NFPWorker class is responsible for managing worker operations, including connecting to a broker, handling jobs, and maintaining keepalive connections. It interacts with the broker using ZeroMQ and manages job queues and events.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
inventory
|
NorFabInventory
|
The inventory object containing base directory information. |
required |
broker
|
str
|
The broker address. |
required |
service
|
str
|
The service name. |
required |
name
|
str
|
The name of the worker. |
required |
exit_event
|
object
|
The event used to signal the worker to exit. |
required |
log_level
|
str
|
The logging level. Defaults to None. |
None
|
log_queue
|
object
|
The logging queue. Defaults to None. |
None
|
multiplier
|
int
|
The multiplier value. Defaults to 6. |
6
|
keepalive
|
int
|
The keepalive interval in milliseconds. Defaults to 2500. |
2500
|
Attributes:
Name | Type | Description |
---|---|---|
inventory |
NorFabInventory
|
The inventory object. |
broker |
str
|
The broker address. |
service |
bytes
|
The service name encoded in UTF-8. |
name |
str
|
The name of the worker. |
exit_event |
The event used to signal the worker to exit. |
|
broker_socket |
The broker socket, initialized to None. |
|
multiplier |
int
|
The multiplier value. |
keepalive |
int
|
The keepalive interval in milliseconds. |
socket_lock |
Lock
|
The lock used to protect the socket object. |
base_dir |
str
|
The base directory for the worker. |
base_dir_jobs |
str
|
The base directory for job files. |
destroy_event |
Event
|
The event used to signal the destruction of the worker. |
request_thread |
The request thread, initialized to None. |
|
reply_thread |
The reply thread, initialized to None. |
|
close_thread |
The close thread, initialized to None. |
|
recv_thread |
The receive thread, initialized to None. |
|
event_thread |
The event thread, initialized to None. |
|
post_queue |
Queue
|
The queue for POST requests. |
get_queue |
Queue
|
The queue for GET requests. |
delete_queue |
Queue
|
The queue for DELETE requests. |
event_queue |
Queue
|
The queue for events. |
public_keys_dir |
str
|
The directory for public keys. |
secret_keys_dir |
str
|
The directory for private keys. |
ctx |
Context
|
The ZeroMQ context. |
poller |
Poller
|
The ZeroMQ poller. |
queue_filename |
str
|
The filename for the job queue. |
queue_done_filename |
str
|
The filename for the completed job queue. |
client |
NFPClient
|
The NFP client instance. |
Source code in norfab\core\worker.py
645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 |
|
setup_logging(log_queue, log_level: str) -> None
¤
Configures logging for the worker.
This method sets up the logging configuration using a provided log queue and log level.
It updates the logging configuration dictionary with the given log queue and log level,
and then applies the configuration using logging.config.dictConfig
.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
log_queue
|
Queue
|
The queue to be used for logging. |
required |
log_level
|
str
|
The logging level to be set. If None, the default level is used. |
required |
Source code in norfab\core\worker.py
734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 |
|
reconnect_to_broker()
¤
Connect or reconnect to the broker.
This method handles the connection or reconnection process to the broker. It performs the following steps:
- If there is an existing broker socket, it sends a disconnect message, unregisters the socket from the poller, and closes the socket.
- Creates a new DEALER socket and sets its identity.
- Loads the client's secret and public keys for CURVE authentication.
- Loads the server's public key for CURVE authentication.
- Connects the socket to the broker.
- Registers the socket with the poller for incoming messages.
- Sends a READY message to the broker to register the service.
- Starts or restarts the keepalive mechanism to maintain the connection.
- Increments the reconnect statistics counter.
- Logs the successful registration to the broker.
Source code in norfab\core\worker.py
751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 |
|
send_to_broker(command, msg: list = None)
¤
Send a message to the broker.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
command
|
str
|
The command to send to the broker. Must be one of NFP.READY, NFP.DISCONNECT, NFP.RESPONSE, or NFP.EVENT. |
required |
msg
|
list
|
The message to send. If not provided, a default message will be created based on the command. |
None
|
Logs
Logs an error if the command is unsupported. Logs a debug message with the message being sent.
Thread Safety
This method is thread-safe and uses a lock to ensure that the broker socket is accessed by only one thread at a time.
Source code in norfab\core\worker.py
825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 |
|
load_inventory() -> dict
¤
Load inventory data from the broker for this worker.
This function retrieves inventory data from the broker service using the worker's name. It logs the received inventory data and returns the results if available.
Returns:
Name | Type | Description |
---|---|---|
dict |
dict
|
The inventory data results if available, otherwise an empty dictionary. |
Source code in norfab\core\worker.py
859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 |
|
worker_exit() -> None
¤
Method to override in child classes with a set of actions to perform on exit call.
This method should be implemented by subclasses to define any cleanup or finalization tasks that need to be performed when the worker is exiting.
Source code in norfab\core\worker.py
880 881 882 883 884 885 886 887 |
|
get_inventory() -> Dict
¤
Retrieve the worker's inventory.
This method should be overridden in child classes to provide the specific implementation for retrieving the inventory of a worker.
Returns:
Name | Type | Description |
---|---|---|
Dict |
Dict
|
A dictionary representing the worker's inventory. |
Raises:
Type | Description |
---|---|
NotImplementedError
|
If the method is not overridden in a child class. |
Source code in norfab\core\worker.py
889 890 891 892 893 894 895 896 897 898 899 900 901 902 |
|
get_version() -> Dict
¤
Retrieve the version report of the worker.
This method should be overridden in child classes to provide the specific version report of the worker.
Returns:
Name | Type | Description |
---|---|---|
Dict |
Dict
|
A dictionary containing the version information of the worker. |
Raises:
Type | Description |
---|---|
NotImplementedError
|
If the method is not overridden in a child class. |
Source code in norfab\core\worker.py
904 905 906 907 908 909 910 911 912 913 914 915 916 917 |
|
destroy(message=None)
¤
Cleanly shuts down the worker by performing the following steps:
- Calls the worker_exit method to handle any worker-specific exit procedures.
- Sets the destroy_event to signal that the worker is being destroyed.
- Calls the destroy method on the client to clean up client resources.
- Joins all the threads (request_thread, reply_thread, close_thread, event_thread, recv_thread) if they are not None, ensuring they have finished execution.
- Destroys the context with a linger period of 0 to immediately close all sockets.
- Stops the keepaliver to cease any keepalive signals.
- Logs an informational message indicating that the worker has been destroyed, including an optional message.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
message
|
str
|
An optional message to include in the log when the worker is destroyed. |
None
|
Source code in norfab\core\worker.py
919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 |
|
is_url(url: str) -> bool
¤
Check if the given string is a URL supported by NorFab File Service.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
url
|
str
|
The URL to check. |
required |
Returns:
Name | Type | Description |
---|---|---|
bool |
bool
|
True if the URL supported by NorFab File Service, False otherwise. |
Source code in norfab\core\worker.py
957 958 959 960 961 962 963 964 965 966 967 |
|
fetch_file(url: str, raise_on_fail: bool = False, read: bool = True) -> str
¤
Function to download file from broker File Sharing Service
Parameters:
Name | Type | Description | Default |
---|---|---|---|
url
|
str
|
file location string in |
required |
raise_on_fail
|
bool
|
raise FIleNotFoundError if download fails |
False
|
read
|
bool
|
if True returns file content, return OS path to saved file otherwise |
True
|
Returns:
Name | Type | Description |
---|---|---|
str |
str
|
File content if read is True, otherwise OS path to the saved file. |
Raises:
Type | Description |
---|---|
FileNotFoundError
|
If raise_on_fail is True and the download fails. |
Source code in norfab\core\worker.py
969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 |
|
jinja2_render_templates(templates: list[str], context: dict = None, filters: dict = None) -> str
¤
Renders a list of Jinja2 templates with the given context and optional filters.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
templates
|
list[str]
|
A list of Jinja2 template strings or NorFab file paths. |
required |
context
|
dict
|
A dictionary containing the context variables for rendering the templates. |
None
|
filters
|
dict
|
A dictionary of custom Jinja2 filters to be used during rendering. |
None
|
Returns:
Name | Type | Description |
---|---|---|
str |
str
|
The rendered templates concatenated into a single string. |
Source code in norfab\core\worker.py
997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 |
|
jinja2_fetch_template(url: str) -> str
¤
Helper function to recursively download a Jinja2 template along with other templates referenced using "include" statements.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
url
|
str
|
A URL in the format |
required |
Returns:
Name | Type | Description |
---|---|---|
str |
str
|
The file path of the downloaded Jinja2 template. |
Raises:
Type | Description |
---|---|
FileNotFoundError
|
If the file download fails. |
Exception
|
If Jinja2 template parsing fails. |
Source code in norfab\core\worker.py
1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 |
|
event(data: Union[NorFabEvent, str], **kwargs) -> None
¤
Handles the creation and emission of an event.
This method takes event data, processes it, and sends it to the event queue. It also saves the event data locally for future reference.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
data
|
Union[NorFabEvent, str]
|
The event data, which can be either an instance of NorFabEvent or a string. |
required |
**kwargs
|
Additional keyword arguments to be passed when creating a NorFabEvent instance if |
{}
|
Logs
Error: Logs an error message if the event data cannot be formed.
Source code in norfab\core\worker.py
1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 |
|
job_details(uuid: str, data: bool = True, result: bool = True, events: bool = True) -> Result
¤
Method to get job details by UUID for completed jobs.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
uuid
|
str
|
The job UUID to return details for. |
required |
data
|
bool
|
If True, return job data. |
True
|
result
|
bool
|
If True, return job result. |
True
|
events
|
bool
|
If True, return job events. |
True
|
Returns:
Name | Type | Description |
---|---|---|
Result |
Result
|
A Result object with the job details. |
Source code in norfab\core\worker.py
1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 |
|
job_list(pending: bool = True, completed: bool = True, task: str = None, last: int = None, client: str = None, uuid: str = None) -> Result
¤
Method to list worker jobs completed and pending.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
pending
|
bool
|
If True or None, return pending jobs. If False, skip pending jobs. |
True
|
completed
|
bool
|
If True or None, return completed jobs. If False, skip completed jobs. |
True
|
task
|
str
|
If provided, return only jobs with this task name. |
None
|
last
|
int
|
If provided, return only the last N completed and last N pending jobs. |
None
|
client
|
str
|
If provided, return only jobs submitted by this client. |
None
|
uuid
|
str
|
If provided, return only the job with this UUID. |
None
|
Returns:
Name | Type | Description |
---|---|---|
Result |
Result
|
Result object with a list of jobs. |
Source code in norfab\core\worker.py
1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 |
|
work()
¤
Starts multiple threads to handle different tasks and processes jobs in a loop until an exit or destroy event is set.
Threads started:
- request_thread: Handles posting requests.
- reply_thread: Handles getting replies.
- close_thread: Handles closing operations.
- event_thread: Handles event processing.
- recv_thread: Handles receiving data.
Main work loop:
- Continuously checks for jobs to process from a queue file.
- Loads job data and executes the corresponding task.
- Saves the result of the job to a reply file.
- Marks the job as processed by moving it from the queue file to a queue done file.
Ensures proper cleanup by calling the destroy method when exit or destroy events are set.
Source code in norfab\core\worker.py
1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 |
|
dumper(data, filename)
¤
Serializes and saves data to a file using pickle.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
data
|
any
|
The data to be serialized and saved. |
required |
filename
|
str
|
The name of the file where the data will be saved. |
required |
Source code in norfab\core\worker.py
283 284 285 286 287 288 289 290 291 292 293 |
|
loader(filename)
¤
Load and deserialize a Python object from a file.
This function opens a file in binary read mode, reads its content, and deserializes it using the pickle module. The file access is synchronized using a file write lock to ensure thread safety.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
filename
|
str
|
The path to the file to be loaded. |
required |
Returns:
Name | Type | Description |
---|---|---|
object |
The deserialized Python object from the file. |
Source code in norfab\core\worker.py
296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 |
|
request_filename(suuid: Union[str, bytes], base_dir_jobs: str)
¤
Returns a freshly allocated request filename for the given UUID string.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
suuid
|
Union[str, bytes]
|
The UUID string or bytes. |
required |
base_dir_jobs
|
str
|
The base directory where job files are stored. |
required |
Returns:
Name | Type | Description |
---|---|---|
str |
The full path to the request file with the given UUID. |
Source code in norfab\core\worker.py
315 316 317 318 319 320 321 322 323 324 325 326 327 |
|
reply_filename(suuid: Union[str, bytes], base_dir_jobs: str)
¤
Returns a freshly allocated reply filename for the given UUID string.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
suuid
|
Union[str, bytes]
|
The UUID string or bytes. |
required |
base_dir_jobs
|
str
|
The base directory where job files are stored. |
required |
Returns:
Name | Type | Description |
---|---|---|
str |
The full path to the reply file with the given UUID. |
Source code in norfab\core\worker.py
330 331 332 333 334 335 336 337 338 339 340 341 342 |
|
event_filename(suuid: Union[str, bytes], base_dir_jobs: str)
¤
Returns a freshly allocated event filename for the given UUID string.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
suuid
|
Union[str, bytes]
|
The UUID string or bytes. |
required |
base_dir_jobs
|
str
|
The base directory where job files are stored. |
required |
Returns:
Name | Type | Description |
---|---|---|
str |
The full path to the event file with the given UUID. |
Source code in norfab\core\worker.py
345 346 347 348 349 350 351 352 353 354 355 356 357 |
|
recv(worker, destroy_event)
¤
Thread to process receive messages from broker.
This function runs in a loop, polling the worker's broker socket for messages every second. When a message is received, it processes the message based on the command type and places it into the appropriate queue or handles it accordingly. If the keepaliver thread is not alive, it logs a warning and attempts to reconnect to the broker.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
worker
|
Worker
|
The worker instance that contains the broker socket and queues. |
required |
destroy_event
|
Event
|
An event to signal the thread to stop. |
required |
Commands
- NFP.POST: Places the message into the post_queue.
- NFP.DELETE: Places the message into the delete_queue.
- NFP.GET: Places the message into the get_queue.
- NFP.KEEPALIVE: Processes a keepalive heartbeat.
- NFP.DISCONNECT: Attempts to reconnect to the broker.
- Other: Logs an invalid input message.
Source code in norfab\core\worker.py
539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 |
|