# Path: mrq/context.py
# def setup_context(**kwargs):
#     """ Setup MRQ's environment.
# 
#         Note: gevent should probably be initialized too if you want to use concurrency.
#     """
#     set_current_config(get_config(**kwargs))
# 
# Path: mrq/job.py
# def queue_raw_jobs(queue, params_list, **kwargs):
#     """ Queue some jobs on a raw queue """
# 
#     from .queue import Queue
#     queue_obj = Queue(queue)
#     queue_obj.enqueue_raw_jobs(params_list, **kwargs)
#     # No need to store queue size as we already have a fast way to get raw queue size


import sys
import time
from mrq.context import setup_context
from mrq.job import queue_raw_jobs
#!/usr/bin/env python

setup_context()

queue = sys.argv[1]
n = int(sys.argv[2])
t = int(sys.argv[3])

if queue in ("example_timed_set"):
    now = time.time()
    # every 10 seconds

# Path: mrq/context.py
# def setup_context(**kwargs):
#     """ Setup MRQ's environment.
# 
#         Note: gevent should probably be initialized too if you want to use concurrency.
#     """
#     set_current_config(get_config(**kwargs))
# 
# Path: mrq/job.py
# def queue_raw_jobs(queue, params_list, **kwargs):
#     """ Queue some jobs on a raw queue """
# 
#     from .queue import Queue
#     queue_obj = Queue(queue)
#     queue_obj.enqueue_raw_jobs(params_list, **kwargs)
#     # No need to store queue size as we already have a fast way to get raw queue size


# Path: examples/timed_set/enqueue_raw_jobs.py
import sys
import time
from mrq.context import setup_context
from mrq.job import queue_raw_jobs

#!/usr/bin/env python

setup_context()

queue = sys.argv[1]
n = int(sys.argv[2])
t = int(sys.argv[3])

if queue in ("example_timed_set"):
    now = time.time()
    # every 10 seconds

    queue_raw_jobs(queue, {"task_%s" % _: now + (_ + 1) * t for _ in range(n)})