annotate Resources/Samples/Python/HighPerformanceAutoRouting.py @ 1432:0ac74fa21db8

rename IServerIndexListener as IDatabaseListener
author Sebastien Jodogne <s.jodogne@gmail.com>
date Tue, 30 Jun 2015 12:51:29 +0200
parents 6e7e5ed91c2d
children b1291df2f780
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
404
4b9a7010b1ea sample of routing
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1 #!/usr/bin/python
4b9a7010b1ea sample of routing
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2 # -*- coding: utf-8 -*-
4b9a7010b1ea sample of routing
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3
747
44382c8bcd15 added explicit licensing terms for samples
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 413
diff changeset
4 # Orthanc - A Lightweight, RESTful DICOM Store
1288
6e7e5ed91c2d upgrade to year 2015
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1184
diff changeset
5 # Copyright (C) 2012-2015 Sebastien Jodogne, Medical Physics
6e7e5ed91c2d upgrade to year 2015
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1184
diff changeset
6 # Department, University Hospital of Liege, Belgium
747
44382c8bcd15 added explicit licensing terms for samples
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 413
diff changeset
7 #
44382c8bcd15 added explicit licensing terms for samples
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 413
diff changeset
8 # This program is free software: you can redistribute it and/or
44382c8bcd15 added explicit licensing terms for samples
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 413
diff changeset
9 # modify it under the terms of the GNU General Public License as
44382c8bcd15 added explicit licensing terms for samples
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 413
diff changeset
10 # published by the Free Software Foundation, either version 3 of the
44382c8bcd15 added explicit licensing terms for samples
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 413
diff changeset
11 # License, or (at your option) any later version.
44382c8bcd15 added explicit licensing terms for samples
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 413
diff changeset
12 #
44382c8bcd15 added explicit licensing terms for samples
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 413
diff changeset
13 # This program is distributed in the hope that it will be useful, but
44382c8bcd15 added explicit licensing terms for samples
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 413
diff changeset
14 # WITHOUT ANY WARRANTY; without even the implied warranty of
44382c8bcd15 added explicit licensing terms for samples
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 413
diff changeset
15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
44382c8bcd15 added explicit licensing terms for samples
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 413
diff changeset
16 # General Public License for more details.
44382c8bcd15 added explicit licensing terms for samples
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 413
diff changeset
17 #
44382c8bcd15 added explicit licensing terms for samples
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 413
diff changeset
18 # You should have received a copy of the GNU General Public License
44382c8bcd15 added explicit licensing terms for samples
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 413
diff changeset
19 # along with this program. If not, see <http://www.gnu.org/licenses/>.
44382c8bcd15 added explicit licensing terms for samples
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 413
diff changeset
20
44382c8bcd15 added explicit licensing terms for samples
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 413
diff changeset
21
404
4b9a7010b1ea sample of routing
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
22
4b9a7010b1ea sample of routing
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
23 URL = 'http://localhost:8042'
4b9a7010b1ea sample of routing
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
24 TARGET = 'sample'
4b9a7010b1ea sample of routing
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
25
4b9a7010b1ea sample of routing
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
26
4b9a7010b1ea sample of routing
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
27 #
4b9a7010b1ea sample of routing
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
28 # This sample code shows how to setup a simple, high-performance DICOM
4b9a7010b1ea sample of routing
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
29 # auto-routing. All the DICOM instances that arrive inside Orthanc
4b9a7010b1ea sample of routing
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
30 # will be sent to a remote modality. A producer-consumer pattern is
4b9a7010b1ea sample of routing
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
31 # used. The target modality is specified by the TARGET variable above:
4b9a7010b1ea sample of routing
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
32 # It must match an entry in the Orthanc configuration file inside the
4b9a7010b1ea sample of routing
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
33 # "DicomModalities" section.
4b9a7010b1ea sample of routing
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
34 #
4b9a7010b1ea sample of routing
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
35 # NOTE: This sample only works with Orthanc >= 0.5.2. Make sure that
4b9a7010b1ea sample of routing
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
36 # Orthanc was built with "-DCMAKE_BUILD_TYPE=Release" to get the best
4b9a7010b1ea sample of routing
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
37 # performance.
4b9a7010b1ea sample of routing
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
38 #
4b9a7010b1ea sample of routing
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
39
4b9a7010b1ea sample of routing
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
40 import Queue
4b9a7010b1ea sample of routing
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
41 import sys
4b9a7010b1ea sample of routing
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
42 import time
4b9a7010b1ea sample of routing
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
43 import threading
4b9a7010b1ea sample of routing
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
44
4b9a7010b1ea sample of routing
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
45 import RestToolbox
4b9a7010b1ea sample of routing
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
46
4b9a7010b1ea sample of routing
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
47
4b9a7010b1ea sample of routing
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
48 #
4b9a7010b1ea sample of routing
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
49 # Queue that is shared between the producer and the consumer
4b9a7010b1ea sample of routing
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
50 # threads. It holds the instances that are still to be sent.
4b9a7010b1ea sample of routing
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
51 #
4b9a7010b1ea sample of routing
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
52
4b9a7010b1ea sample of routing
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
53 queue = Queue.Queue()
4b9a7010b1ea sample of routing
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
54
4b9a7010b1ea sample of routing
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
55
4b9a7010b1ea sample of routing
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
56 #
4b9a7010b1ea sample of routing
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
57 # The producer thread. It monitors the arrival of new instances into
4b9a7010b1ea sample of routing
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
58 # Orthanc, and pushes their ID into the shared queue. This code is
4b9a7010b1ea sample of routing
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
59 # based upon the "ChangesLoop.py" sample code.
4b9a7010b1ea sample of routing
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
60 #
4b9a7010b1ea sample of routing
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
61
4b9a7010b1ea sample of routing
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
62 def Producer(queue):
4b9a7010b1ea sample of routing
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
63 current = 0
4b9a7010b1ea sample of routing
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
64
4b9a7010b1ea sample of routing
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
65 while True:
4b9a7010b1ea sample of routing
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
66 r = RestToolbox.DoGet(URL + '/changes', {
4b9a7010b1ea sample of routing
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
67 'since' : current,
4b9a7010b1ea sample of routing
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
68 'limit' : 4 # Retrieve at most 4 changes at once
4b9a7010b1ea sample of routing
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
69 })
4b9a7010b1ea sample of routing
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
70
4b9a7010b1ea sample of routing
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
71 for change in r['Changes']:
4b9a7010b1ea sample of routing
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
72 # We are only interested interested in the arrival of new instances
4b9a7010b1ea sample of routing
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
73 if change['ChangeType'] == 'NewInstance':
4b9a7010b1ea sample of routing
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
74 queue.put(change['ID'])
4b9a7010b1ea sample of routing
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
75
4b9a7010b1ea sample of routing
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
76 current = r['Last']
4b9a7010b1ea sample of routing
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
77
4b9a7010b1ea sample of routing
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
78 if r['Done']:
4b9a7010b1ea sample of routing
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
79 time.sleep(1)
4b9a7010b1ea sample of routing
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
80
4b9a7010b1ea sample of routing
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
81
4b9a7010b1ea sample of routing
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
82 #
4b9a7010b1ea sample of routing
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
83 # The consumer thread. It continuously reads the instances from the
4b9a7010b1ea sample of routing
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
84 # queue, and send them to the remote modality. Each time a packet of
4b9a7010b1ea sample of routing
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
85 # instances is sent, a single DICOM connexion is used, hence improving
4b9a7010b1ea sample of routing
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
86 # the performance.
4b9a7010b1ea sample of routing
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
87 #
4b9a7010b1ea sample of routing
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
88
4b9a7010b1ea sample of routing
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
89 def Consumer(queue):
4b9a7010b1ea sample of routing
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
90 TIMEOUT = 0.1
4b9a7010b1ea sample of routing
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
91
4b9a7010b1ea sample of routing
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
92 while True:
4b9a7010b1ea sample of routing
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
93 instances = []
4b9a7010b1ea sample of routing
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
94
4b9a7010b1ea sample of routing
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
95 while True:
4b9a7010b1ea sample of routing
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
96 try:
4b9a7010b1ea sample of routing
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
97 # Block for a while, waiting for the arrival of a new
4b9a7010b1ea sample of routing
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
98 # instance
4b9a7010b1ea sample of routing
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
99 instance = queue.get(True, TIMEOUT)
4b9a7010b1ea sample of routing
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
100
4b9a7010b1ea sample of routing
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
101 # A new instance has arrived: Record its ID
4b9a7010b1ea sample of routing
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
102 instances.append(instance)
4b9a7010b1ea sample of routing
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
103 queue.task_done()
4b9a7010b1ea sample of routing
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
104
4b9a7010b1ea sample of routing
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
105 except Queue.Empty:
4b9a7010b1ea sample of routing
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
106 # Timeout: No more data was received
4b9a7010b1ea sample of routing
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
107 break
4b9a7010b1ea sample of routing
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
108
4b9a7010b1ea sample of routing
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
109 if len(instances) > 0:
1184
4e9d517503ae port to Python3
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1144
diff changeset
110 print('Sending a packet of %d instances' % len(instances))
404
4b9a7010b1ea sample of routing
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
111 start = time.time()
4b9a7010b1ea sample of routing
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
112
4b9a7010b1ea sample of routing
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
113 # Send all the instances with a single DICOM connexion
4b9a7010b1ea sample of routing
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
114 RestToolbox.DoPost('%s/modalities/sample/store' % URL, instances)
4b9a7010b1ea sample of routing
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
115
4b9a7010b1ea sample of routing
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
116 # Remove all the instances from Orthanc
4b9a7010b1ea sample of routing
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
117 for instance in instances:
4b9a7010b1ea sample of routing
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
118 RestToolbox.DoDelete('%s/instances/%s' % (URL, instance))
4b9a7010b1ea sample of routing
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
119
413
47d63c941902 clearing /exports and /changes
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 404
diff changeset
120 # Clear the log of the exported instances (to prevent the
1143
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 747
diff changeset
121 # SQLite database from growing indefinitely). More simply,
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 747
diff changeset
122 # you could also set the "LogExportedResources" option to
1144
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1143
diff changeset
123 # "false" in the configuration file since Orthanc 0.8.3.
413
47d63c941902 clearing /exports and /changes
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 404
diff changeset
124 RestToolbox.DoDelete('%s/exports' % URL)
47d63c941902 clearing /exports and /changes
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 404
diff changeset
125
404
4b9a7010b1ea sample of routing
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
126 end = time.time()
1184
4e9d517503ae port to Python3
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1144
diff changeset
127 print('The packet of %d instances has been sent in %d seconds' % (len(instances), end - start))
404
4b9a7010b1ea sample of routing
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
128
4b9a7010b1ea sample of routing
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
129
4b9a7010b1ea sample of routing
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
130 #
4b9a7010b1ea sample of routing
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
131 # Thread to display the progress
4b9a7010b1ea sample of routing
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
132 #
4b9a7010b1ea sample of routing
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
133
4b9a7010b1ea sample of routing
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
134 def PrintProgress(queue):
4b9a7010b1ea sample of routing
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
135 while True:
1184
4e9d517503ae port to Python3
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1144
diff changeset
136 print('Current queue size: %d' % (queue.qsize()))
404
4b9a7010b1ea sample of routing
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
137 time.sleep(1)
4b9a7010b1ea sample of routing
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
138
4b9a7010b1ea sample of routing
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
139
4b9a7010b1ea sample of routing
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
140 #
4b9a7010b1ea sample of routing
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
141 # Start the various threads
4b9a7010b1ea sample of routing
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
142 #
4b9a7010b1ea sample of routing
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
143
4b9a7010b1ea sample of routing
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
144 progress = threading.Thread(None, PrintProgress, None, (queue, ))
4b9a7010b1ea sample of routing
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
145 progress.daemon = True
4b9a7010b1ea sample of routing
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
146 progress.start()
4b9a7010b1ea sample of routing
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
147
4b9a7010b1ea sample of routing
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
148 producer = threading.Thread(None, Producer, None, (queue, ))
4b9a7010b1ea sample of routing
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
149 producer.daemon = True
4b9a7010b1ea sample of routing
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
150 producer.start()
4b9a7010b1ea sample of routing
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
151
4b9a7010b1ea sample of routing
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
152 consumer = threading.Thread(None, Consumer, None, (queue, ))
4b9a7010b1ea sample of routing
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
153 consumer.daemon = True
4b9a7010b1ea sample of routing
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
154 consumer.start()
4b9a7010b1ea sample of routing
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
155
4b9a7010b1ea sample of routing
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
156
4b9a7010b1ea sample of routing
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
157 #
4b9a7010b1ea sample of routing
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
158 # Active waiting for Ctrl-C
4b9a7010b1ea sample of routing
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
159 #
4b9a7010b1ea sample of routing
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
160
4b9a7010b1ea sample of routing
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
161 while True:
4b9a7010b1ea sample of routing
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
162 time.sleep(0.1)