Skip to content

Instantly share code, notes, and snippets.

@ox1111
Created March 15, 2019 07:40
Show Gist options
  • Save ox1111/bbf3d7c14e02b93a87f51536e472f0a4 to your computer and use it in GitHub Desktop.
Save ox1111/bbf3d7c14e02b93a87f51536e472f0a4 to your computer and use it in GitHub Desktop.
import redis
import time
def read_messageq():
r = redis.StrictRedis(host='192.168.1.48', port=6379, db=0)
p = r.pubsub()
p.subscribe('startScripts')
PAUSE = True
while PAUSE:
print("Waiting For redisStarter...")
# Checks for message
message = p.get_message()
if message:
# Get data from message
command = message['data']
# Checks for START message
if command == b'START':
PAUSE = False
time.sleep(1)
print("Permission to start...")
if __name__ == '__main__':
read_messageq()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment