code: def put(self, udid):
          ''' finish task '''
          data = tornado.escape.json_decode(self.request.body)
          id = data['id']
          result = data['result']
          if self.results.get(id) is None:
              self.results[id] = result
          else:
              that = self.results[id]
              that.write(json.dumps(result))
              that.finish()
              self.results.pop(id, None)
          self.write('Success')
          self.finish(f put(self, udid):
          ''' finish task '''
          data = tornado.escape.json_decode(self.request.body)
          id = data['id']
          result = data['result']
          if self.results.get(id) is None:
              self.results[id] = result
          else:
              that = self.results[id]
              that.write(json.dumps(result))
              that.finish()
              self.results.pop(id, None)
          self.write('Success')
          self.finish()
docs: finish task