Commit 27d96f2a1232630d6341c4cc5d4acc986d41fe86
1 parent
08249cb9
add quit_requested handling on MessageQueue. Now with that check up the services…
… that have infinite loop can quit when the quit_requested is set to true.
Showing
2 changed files
with
6 additions
and
1 deletions
Show diff stats
calexium_lib/net_services/CXM_net_services.anubis
| @@ -116,6 +116,9 @@ define One | @@ -116,6 +116,9 @@ define One | ||
| 116 | MessageQueue queue, | 116 | MessageQueue queue, |
| 117 | List(NetService) net_services | 117 | List(NetService) net_services |
| 118 | ) = | 118 | ) = |
| 119 | + if queue.quit_requested(uniqe) then | ||
| 120 | + unique | ||
| 121 | + else | ||
| 119 | println("PRE SERVICE message_receiver "+"["+virtual_machine_id + "]"); | 122 | println("PRE SERVICE message_receiver "+"["+virtual_machine_id + "]"); |
| 120 | if queue.get_next_received_Message(1) is | 123 | if queue.get_next_received_Message(1) is |
| 121 | { | 124 | { |
calexium_lib/net_services_protocols/ftp_client.anubis
| @@ -142,7 +142,9 @@ public define Maybe(One) | @@ -142,7 +142,9 @@ public define Maybe(One) | ||
| 142 | with queue = create_MessageQueue, | 142 | with queue = create_MessageQueue, |
| 143 | message_transceiver(conn, queue); | 143 | message_transceiver(conn, queue); |
| 144 | if request_for_service(queue) then | 144 | if request_for_service(queue) then |
| 145 | - get_file(queue, remote_file, local_file) | 145 | + with result = get_file(queue, remote_file, local_file), |
| 146 | + queue.quit(unique); | ||
| 147 | + result | ||
| 146 | else | 148 | else |
| 147 | println("Service not found");failure | 149 | println("Service not found");failure |
| 148 | } | 150 | } |