Permalink
Browse files

Added shortcut util for submitting external jobs.

  • Loading branch information...
1 parent c3086dd commit b628404f45972e4eaf7b79b29a67016bddc9daff Vladimir Gorej committed Nov 21, 2012
Showing with 6 additions and 0 deletions.
  1. +6 −0 django_gearman_commands/__init__.py
@@ -6,6 +6,7 @@
import gearman
+from django.core.management import call_command
from django.core.management.base import BaseCommand, CommandError
from django.conf import settings
@@ -162,3 +163,8 @@ def get_server_info(self):
def get_namespace():
"""Namespace to suffix function on a mutialized gearman."""
return django_gearman_commands.settings.GEARMAN_CLIENT_NAMESPACE
+
+
+def submit_job(task_name, data='', **options):
+ """Shortcut util for submitting job in standard way."""
+ return call_command('gearman_submit_job', task_name, data, **options)

0 comments on commit b628404

Please sign in to comment.