def handler(signum, frame):
    print('Signal handler called with signal', signum)
raise IOError("Couldn't open device!")
signal.signal(signal.SIGALRM, handler)
signal.alarm(5)
how to implement redis's pubsub timeout feature?