Mercurial > templog
comparison py/sensor_ds18b20.py @ 259:26eee8591f61
long polling works
author | Matt Johnston <matt@ucc.asn.au> |
---|---|
date | Tue, 09 Jun 2015 23:27:44 +0800 |
parents | 659953f2ee03 |
children | 20c89630be6c |
comparison
equal
deleted
inserted
replaced
256:6d06795aefbb | 259:26eee8591f61 |
---|---|
33 | 33 |
34 @asyncio.coroutine | 34 @asyncio.coroutine |
35 def run(self): | 35 def run(self): |
36 while True: | 36 while True: |
37 yield from self.do() | 37 yield from self.do() |
38 yield from self.server.sleep(config.SENSOR_SLEEP) | 38 yield from asyncio.sleep(config.SENSOR_SLEEP) |
39 | 39 |
40 | 40 |
41 @asyncio.coroutine | 41 @asyncio.coroutine |
42 def read_wait(self, f): | 42 def read_wait(self, f): |
43 # handles a blocking file read with a threadpool. A | 43 # handles a blocking file read with a threadpool. A |