Change print statement to print function in docs (#985)

main
Aly Sivji 6 years ago committed by Selwin Ong
parent 6a376191d9
commit a2f245a0c1

@ -38,11 +38,11 @@ q = Queue(connection=redis_conn) # no args implies the default queue
# Delay execution of count_words_at_url('http://nvie.com')
job = q.enqueue(count_words_at_url, 'http://nvie.com')
print job.result # => None
print(job.result) # => None
# Now, wait a while, until the worker is finished
time.sleep(2)
print job.result # => 889
print(job.result) # => 889
{% endhighlight %}
If you want to put the work on a specific queue, simply specify its name:
@ -107,7 +107,7 @@ redis_conn = Redis()
q = Queue(connection=redis_conn)
# Getting the number of jobs in the queue
print len(q)
print(len(q))
# Retrieving jobs
queued_job_ids = q.job_ids # Gets a list of job IDs from the queue
@ -160,7 +160,7 @@ def add(x, y):
job = add.delay(3, 4)
time.sleep(1)
print job.result
print(job.result)
{% endhighlight %}

@ -20,7 +20,7 @@ from rq import get_current_job
def add(x, y):
job = get_current_job()
print 'Current job: %s' % (job.id,)
print('Current job: %s' % (job.id,))
return x + y
{% endhighlight %}

Loading…
Cancel
Save