|
@@ -20,6 +20,10 @@ class Actor(Thread):
|
|
|
Thread.__init__(self)
|
|
|
self.config = config
|
|
|
self.items = []
|
|
|
+ self.__id = config['id']
|
|
|
+ def getIdentifier(self):
|
|
|
+ return self.__id
|
|
|
+
|
|
|
def init(self,litems):
|
|
|
self.items = litems
|
|
|
def process(self,item):
|
|
@@ -33,8 +37,18 @@ class Actor(Thread):
|
|
|
pass
|
|
|
return stream
|
|
|
def callback(self,channel,method,header,stream):
|
|
|
- print stream
|
|
|
-
|
|
|
+ print [self.getIdentifier(),stream]
|
|
|
+ #message = None
|
|
|
+ #try:
|
|
|
+ #message = json.loads(stream)
|
|
|
+ #except Exception, e:
|
|
|
+ #pass
|
|
|
+ #if message is not None:
|
|
|
+ #if 'id' in message :
|
|
|
+ #if 'payload' in message:
|
|
|
+ #self.execute(message['payload']
|
|
|
+
|
|
|
+
|
|
|
def run(self):
|
|
|
info = {}
|
|
|
host = self.config['api']
|
|
@@ -68,4 +82,8 @@ class Alert(Actor):
|
|
|
|
|
|
config = {"id":"demo","key":"[0v8]-247&7!v3","api":"localhost"}
|
|
|
actor = Kill(config)
|
|
|
-actor.start()
|
|
|
+actor.start()
|
|
|
+
|
|
|
+config = {"id":"demo-100","key":"[0v8]-247&7!v3","api":"localhost"}
|
|
|
+actor_1 = Kill(config)
|
|
|
+actor_1.start()
|