def produce_items(items): r = RedisQueue(**example_config) for i in items: r.send(i)
def produce(amount): r = RedisQueue(**example_config) for i in range(1, amount + 1): r.send(i)
msg_email = EmailMessage() msg_email.set_content(msg) msg_email['Subject'] = subject msg_email['From'] = from_ msg_email['To'] = to s = smtplib.SMTP('localhost') s.send_message(msg_email) s.quit() return True config = { "namespace": "removeme", "key": "tasks", "redis_config": {}, "maxsize": 100 } from meesee import RedisQueue # Note that max_allowed should be alteast one less then maxsize of the config max_allowed = 10000 r = RedisQueue(**config) if len(r) > max_allowed: send_email( "items in quque {} is more then max allowed {}".format( len(r), max_allowed), "*****@*****.**", "*****@*****.**", "alarm title name")
def produce(items): r = RedisQueue(**config) for i in range(items): r.send(i)
def produce(items, configs): r = RedisQueue(**configs[0]) for config in configs: r.set_list_key(key=config['key'], namespace=config['namespace']) for _ in range(items): r.send(config['key'])