def enqueue(method, queue=u'default', timeout=300, event=None, async=True, job_name=None, **kwargs):
 q = get_queue(queue, async=async)
 if (not timeout):
  timeout = (queue_timeout.get(queue) or 300)
 return q.enqueue_call(execute_job, timeout=timeout, kwargs={u'site': frappe.local.site, u'user': frappe.session.user, u'method': method, u'event': event, u'job_name': (job_name or cstr(method)), u'async': async, u'kwargs': kwargs})

def enqueue ( method , queue = u'default' , timeout = 300 , event = None , async = True , job_name = None , ** kwargs ) : q = get_queue ( queue , async = async ) if ( not timeout ) : timeout = ( queue_timeout . get ( queue ) or 300 ) return q . enqueue_call ( execute_job , timeout = timeout , kwargs = { u'site' : frappe . local . site , u'user' : frappe . session . user , u'method' : method , u'event' : event , u'job_name' : ( job_name or cstr ( method ) ) , u'async' : async , u'kwargs' : kwargs } )
enqueue method to be executed using a background worker .