Add print statements for debugging

This commit is contained in:
2024-03-03 01:50:04 -05:00
parent d60c0d419b
commit 07ee70b002

View File

@@ -101,6 +101,7 @@ static void *worker_task(zsock_t *pipe, char *disk_path) {
// Process message
// do something here
printf("Received a message in the worker\n");
// Sending reply
zmsg_send(&msg, pipe);
@@ -128,16 +129,18 @@ int main(int argc, char **argv) {
for (int i = 0; i < worker_count; i++) {
char *path = strtok(argv[i+1], ":");
worker_map[i].name = strtok(NULL, ":");
printf("name: %s\n", worker_map[i].name);
worker_map[i].worker = zactor_new(worker_task, path);
}
char *ep = endpoint();
printf("ep: %s\n", ep);
zsock_t *frontend = zsock_new_router(ep);
free(ep);
while (true) {
zmsg_t *msg = zmsg_recv(frontend);
printf("Received a message in the router\n");
if (!msg) break;
// Find the worker with the given name.