Esempio n. 1
0
 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
Esempio n. 2
0
 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
Esempio n. 3
0
 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
Esempio n. 4
0
 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