#NEWLINE# def task( self , queue = 'kuyruk' , local = False , retry = 0 , max_run_time = None ) : #NEWLINE# #INDENT# '\n        Wrap functions with this decorator to convert them to *tasks*.\n        After wrapping, calling the function will send a message to\n        a queue instead of running the function.\n\n        :param queue: Queue name for the tasks.\n        :param retry: Retry this times before give up.\n            The failed task will be retried in the same worker.\n        :param max_run_time: Maximum allowed time in seconds for task to\n            complete.\n        :param local: Append hostname to the queue name. Worker needs to be\n            started on the local queue to receive this task.\n        :return: Callable :class:`~kuyruk.Task` object wrapping the original\n            function.\n\n        ' #NEWLINE# def decorator( ) : #NEWLINE# #INDENT# def inner( f ) : #NEWLINE# #INDENT# queue_ = ( 'kuyruk' if callable ( queue ) else queue ) #NEWLINE# return Task ( f , self , queue = queue_ , local = local , retry = retry , max_run_time = max_run_time ) #NEWLINE# #UNINDENT# return inner #NEWLINE# #UNINDENT# if callable ( queue ) : #NEWLINE# #INDENT# return decorator ( ) ( queue ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# return decorator ( )