def asyncGET(self, payload=None, timeout=COAP_REQ_TIMEOUT, query=None): from pyot.tasks import coapGet res = coapGet.apply_async(args=[self.id, payload, timeout, query], queue=self.host.getQueue()) return res
def GET(self, payload=None, timeout=5, query=None): if CACHING is True: value = getLastResponse(self) if value is not None: return value from pyot.tasks import coapGet res = coapGet.apply_async(args=[self.id, payload, timeout, query], queue=self.host.getQueue()) res.wait() return res.result