Beispiel #1
0
 def store_and_broadcast(self, iterable):
     """iter完这个generator并且返回最后一个"""
     line = ''
     for line in iterable:
         rds.rpush(self.log_key, line)
         rds.publish(self.publish_key, line)
     return line
Beispiel #2
0
 def store_and_broadcast(self, iterable):
     """iter完这个generator并且返回最后一个"""
     line = ''
     for line in iterable:
         rds.rpush(self.log_key, line)
         rds.publish(self.publish_key, line)
     return line
Beispiel #3
0
 def pub_build_finish(self):
     rds.publish(self.publish_key, PUB_END_MESSAGE)
Beispiel #4
0
 def pub_fail(self):
     rds.publish(self.result_key, TASK_RESULT_FAILED)
Beispiel #5
0
 def pub_success(self):
     rds.publish(self.result_key, TASK_RESULT_SUCCESS)
Beispiel #6
0
 def pub_fail(self):
     rds.publish(self.result_key, TASK_RESULT_FAILED)
Beispiel #7
0
 def pub_build_finish(self):
     rds.publish(self.publish_key, PUB_END_MESSAGE)
Beispiel #8
0
 def pub_success(self):
     rds.publish(self.result_key, TASK_RESULT_SUCCESS)
Beispiel #9
0
def publish_to_service_discovery(*appnames):
    for appname in appnames:
        rds.publish(_APP_DISCOVERY_KEY, appname)
        etcd_publisher.publish_app(appname)
Beispiel #10
0
 def publish_status(self, status):
     d = {'container': self.container_id, 'status': status}
     rds.publish(_CONTAINER_PUB_KEY % self.appname, json.dumps(d))
Beispiel #11
0
 def publish_status(self, status):
     d = {'container': self.container_id, 'status': status}
     rds.publish(_CONTAINER_PUB_KEY % self.appname, json.dumps(d))
Beispiel #12
0
def publish_to_service_discovery(*appnames):
    for appname in appnames:
        rds.publish(_APP_DISCOVERY_KEY, appname)
        etcd_publisher.publish_app(appname)