# Path: mrq/task.py
# class Task(object):
# 
#     # Are we the first task that a Job called?
#     is_main_task = False
#     max_concurrency = 0
# 
#     # Default write concern values when setting status=success
#     # http://docs.mongodb.org/manual/reference/write-concern/
#     status_success_update_w = None
#     status_success_update_j = None
# 
#     def __init__(self):
#         pass
# 
#     def run_wrapped(self, params):
#         """ Override this method to provide your own wrapping code """
#         return self.run(params)
# 
#     def run(self, params):
#         """ Override this method with the main code of all your tasks """
#         raise NotImplementedError


from mrq.task import Task
from datetime import datetime
import mrq.context as context
import time


class Print(Task):

    def run(self, params):

        print "Hello World"

        last_task = context.connections.redis.get("test:print")
        if last_task:
          print "Last task was executed %.2f seconds ago" % (time.time() - float(last_task))

        context.connections.redis.set("test:print", time.time())

        print "Given params test is", params["test"]

        print "Bye"



# Path: mrq/task.py
# class Task(object):
# 
#     # Are we the first task that a Job called?
#     is_main_task = False
#     max_concurrency = 0
# 
#     # Default write concern values when setting status=success
#     # http://docs.mongodb.org/manual/reference/write-concern/
#     status_success_update_w = None
#     status_success_update_j = None
# 
#     def __init__(self):
#         pass
# 
#     def run_wrapped(self, params):
#         """ Override this method to provide your own wrapping code """
#         return self.run(params)
# 
#     def run(self, params):
#         """ Override this method with the main code of all your tasks """
#         raise NotImplementedError


# Path: examples/timed_set/example.py
from mrq.task import Task
from datetime import datetime
import mrq.context as context
import time



class Print(Task):

    def run(self, params):

        print "Hello World"

        last_task = context.connections.redis.get("test:print")
        if last_task:
          print "Last task was executed %.2f seconds ago" % (time.time() - float(last_task))

        context.connections.redis.set("test:print", time.time())

        print "Given params test is", params["test"]

        print "Bye"



class RemoveRedisEntry(Task):