Git Product home page Git Product logo

python3-gearman's People

Contributors

josiahmwalton avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

python3-gearman's Issues

No target for documentation link

Documentation link on README.md hasn't any target.

$ curl -i --location http://packages.python.org/python3-gearman/
HTTP/1.1 301 Moved Permanently
Content-length: 0
Location: https://packages.python.org/python3-gearman/

HTTP/1.1 301 Moved Permanently
Server: nginx
Date: Mon, 31 Aug 2020 07:24:53 GMT
Content-Type: text/html
Content-Length: 178
Location: https://pythonhosted.org/python3-gearman/
Strict-Transport-Security: max-age=315360000; includeSubDomains; preload

HTTP/2 404 
content-type: application/octet-stream
server: nginx/1.13.9
accept-ranges: bytes
date: Mon, 31 Aug 2020 07:24:53 GMT
age: 5
x-served-by: cache-bwi5139-BWI, cache-hhn4060-HHN
x-cache: MISS, HIT
x-cache-hits: 0, 1
x-timer: S1598858694.677480,VS0,VE0
strict-transport-security: max-age=31536000; includeSubDomains; preload
x-frame-options: deny
x-xss-protection: 1; mode=block
x-content-type-options: nosniff
x-permitted-cross-domain-policies: none
content-length: 0

Why when upgrade gearman python package from 'gearman(2.0.2)' to 'gearman3(0.2.0)', sometimes job missed and delayed

We often used the following code to connect to gearman server to get job:

gm_worker = gearman.GearmanWorker(['localhost:4730'])
gm_worker.set_client_id('xxxworker')
gm_worker.register_task(b'xxx', func1)
gm_worker.work()
With python 2.7.18 and gearman package 'gearman(2.0.2)' installed, the code worked.

As python 2 is runing to the end of lifetime, we upgrade to python 3.6 and installing gearman python package 'gearman3(0.2.0)'. From then on, job sometimes missed, sometimes delayed no more than 10 seconds.

Now we have 2 worker,one for python 2.7.18 and gearman package 'gearman(2.0.2)', still working, but with limited python 2 time span; another for python 3.6 and gearman python package 'gearman3(0.2.0)', job sometimes missing and sometimes delayed.

Till now, we cannot find the cause.

Can somebody help?

Or are there any similar job server like gearman?

                                    Many Thanks!
                                    Howard

python3-gearman, issue with no module named 'gearman'

Hello,
thanks for providing python3 gearman. I'm trying to use it and after doing "pip install python3-gearman" I still have this issue in my own code:

Test reinstall

$ pip install python3-gearman
Requirement already satisfied: python3-gearman in ./venv/lib/python3.6/site-packages (0.1.0)

Trying to use it in my own code:
import gearman

Which results in:

import gearman
ModuleNotFoundError: No module named 'gearman'

What I'm doing wrong?

python worker on ec2 instance not responding

I have two aws ec2 instances. Client is running on first ec2 instance and worker is running on second ec2 instance. But worker on second ec2 instance is not responding to clients job and not even throwing any error.

client.py:

import python3_gearman as gearman
def check_request_status(job_request):
    if job_request.complete:
	print("Job %s finished!  Result: %s - %s" % (job_request.job.unique, job_request.state, job_request.result))
    elif job_request.timed_out:
	print("Job %s timed out!" % job_request.unique)
    elif job_request.state == JOB_UNKNOWN:
	print("Job %s connection failed!" % job_request.unique)

gm_client = gearman.GearmanClient(['34.253.103.1:4730'])  # 34.253.103.1 :- ip address of worker

completed_job_request = gm_client.submit_job("reverse", "Hello World!")
check_request_status(completed_job_request)

worker.py:

import python3_gearman as gearman
gm_worker = gearman.GearmanWorker(['46.51.130.13:4730'])  # 46.51.130.13 :- ip address of client

def task_listener_reverse(gearman_worker, gearman_job):
    print('Reversing string: ' + gearman_job.data)
    return gearman_job.data[::-1]

# gm_worker.set_client_id is optional
gm_worker.set_client_id('python-worker')
gm_worker.register_task('reverse', task_listener_reverse)

# Enter our work loop and call gm_worker.after_poll() after each time we timeout/see socket activity
gm_worker.work()

Ran gearmand using below command on both the instance:

sudo gearmand --listen=0.0.0.0 -d

Please suggest what's wrong on above method/code.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.