Comments (16)
Thanks for the bug, that must have shown up in one of the recent changes @toudi added.
Can you provide the traceback you receive, so we know where the exception occurs?
from django-gearman.
i suppose it can be connected with the egg package You provide. The current source code needs python-gearman v. 2.x bindings, whether Your egg package has 1.5.x dependencies. I was going to notify You about this but have totally forgotten :/ I also have absolutely no idea about how the egg packages on github work so i don't know how to fix it :(
Please refer to the http://packages.python.org/gearman/1to2.html page for reference - Task class was present in gearman bindings v 1.x and was removed in 2.x.
best regards,
toudi.
from django-gearman.
Oh, that's a different bug then.
I will have to revert commit d00dec3 for now, then, because that allowed gearman > 1.5.0.
If someone wants to fix the code so it is compatible with gearman 2.0, that's fine, I can accept that pull request then.
from django-gearman.
Reverted in commit 3557977. Sorry for the trouble, @klepfish . This library works with gearman 1.5.0 only for now. But again, if someone fixes the code that relies on the old API, then I am happy to merge!
from django-gearman.
ekhm, i believe it's quite opposite ;) The library now works with gearman api v. 2.x, not the 1.5.0. As i mentioned, the Task class was part of 1.x bindings :)
from django-gearman.
Okay I went too fast then. I can put the >=
back in. It only supports 2.x now, right? So I'll change it to >= 2.0
?
from django-gearman.
@klepfish, please try the following commands:
- pip uninstall gearman (this should uninstall gearman v. 1.x bindinds)
- pip install gearman (this should install upstream version - 2.x)
and see if the problem persists.
from django-gearman.
Thanks, @toudi, I was confused. I increased the version info in setup.py in commit a8b05f0.
from django-gearman.
Hi everyone! Did this issue ever get resolved? I'm stuck here right now, can anybody suggest a solution?
Thank you very much!
from django-gearman.
@ekid125 can you do pip freeze | grep gearman on your virtualenv ? I just started from a fresh virtualenv, installed django-gearman package and it pulled gearman v.2 as a dependency.
the Task class was part of gearman v1 client API which is not supported anymore.
from django-gearman.
Hi Toudi!
The Gearman Version that I'm using is 2.0.2. So I guess it will not work. I did however change the call to:
client = GearmanClient()
res = client.submit_job("home.reverse", "reverse me!")
print "Result: '%s'" % res.result
That seemed to help a bit, however when I start "python manage.py gearman_worker" i do get the message that no gearman jobs are found!
I guess that's because of my "fix"?
Thank you!
from django-gearman.
well, the above code states that you have used the gearman client directly (without using django-gearman). Have you registered the jobs, as stated in the README ? (you have to create gearman_jobs.py inside your desired application)
cheers,
toudi
from django-gearman.
Hi @toudi! Yes I did create a File called gearman_jobs.py:
import os
import time
from django_gearman.decorators import gearman_job
@gearman_job
def reverse(input):
"""Reverse a string"""
time.sleep(1)
print "[%s] Reversing string: %s" % (os.getpid(), input)
return input[::-1]
As far as I understood decorating means registering the job as a worker, so gearman knows about it and uses that worker as soon as a job needs to be worked on.
So, I'm probably mixing django_gearman and gearman. So it's brobably best to just stick to one. Since django_gearman doesn't seem to be working with gearman 2.0 and above, I will probably have to stick with gearman.
Maybe you know an alternative?
Thank you!
from django-gearman.
no, those are two separate things. If you use 'just' gearman, then you won't have your django apps integrated.
I just started a plain fresh project, installed everythiing and it seems that you must use decorator calling in order to register the job, like so:
@gearman_job()
rather than
@gearman_job
As you progress with queues you will have to use the parenthesis anyways ;)
cheers,
toudi
from django-gearman.
Hey that worked :-) with "client.submit_job" instead of "client.do_task" it works like a charm!
No I have to test background jobs etc.
Thank you @toudi!
from django-gearman.
Hi @toudi I do have a question about background jobs which is not related to this topic, do you mind if I write you a pm or skype?
Thank you and best regards!
from django-gearman.
Related Issues (7)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from django-gearman.