automated terminal push
This commit is contained in:
21
consumer.py
21
consumer.py
@@ -2,6 +2,8 @@ import stomp
|
||||
import time
|
||||
import SullyGnomeRobot
|
||||
import RestAPIClient
|
||||
import os
|
||||
import signal
|
||||
|
||||
print("## ")
|
||||
print("## starting > JMS consumer (yankee-sully-channels-monthly)")
|
||||
@@ -60,9 +62,10 @@ class MyListener(stomp.ConnectionListener):
|
||||
RestAPIClient.addDownloadFailure(message.body, "error from onmessage (consumer.py)")
|
||||
|
||||
print("## ")
|
||||
print("## starting > JMS consumer (yankee-sully-channels-monthly)")
|
||||
print("## starting > (timed) JMS consumer (yankee-sully-channels-monthly)")
|
||||
print("## ")
|
||||
|
||||
|
||||
conn = stomp.Connection([('67.220.70.106', 61613)])
|
||||
|
||||
conn.set_listener('', MyListener())
|
||||
@@ -75,10 +78,24 @@ print("## ")
|
||||
print("## notification > connected to JMS server (yankee-sully-channels-monthly) 3333")
|
||||
print("## ")
|
||||
|
||||
while True:
|
||||
start_time = time.time()
|
||||
|
||||
print("start time /",start_time)
|
||||
|
||||
counter=0
|
||||
|
||||
while time.time() - start_time < 60:
|
||||
|
||||
counter = counter + 1
|
||||
|
||||
pass
|
||||
|
||||
print("waiting for 60 seconds of elapsed time: ",counter)
|
||||
|
||||
time.sleep(1)
|
||||
|
||||
print("it's been 60 seconds. what up though?")
|
||||
|
||||
conn.disconnect()
|
||||
|
||||
print("disconnected from JMS. i'll holla!")
|
||||
|
||||
Reference in New Issue
Block a user