gearman

Python Gearman get data from background task

情到浓时终转凉″ 提交于 2019-12-06 00:25:13
I'm try use gearman with backgroud tasks and get data progress from worker. In documentation I'm see methods: send_job_data and send_job_status, but with background first method not work (I'm not see data in job.data_updates), but status changes in job.status. I'm use this code for test workers: from gearman import GearmanWorker import time worker = GearmanWorker(['192.168.1.79:4730']) def long_task(work, job): work.send_job_data(job, 'long task') work.send_job_status(job, 0, 3) time.sleep(60) work.send_job_data(job, 'long task2') work.send_job_status(job, 1,3) time.sleep(120) work.send_job

Running PHP script in background using Ant

試著忘記壹切 提交于 2019-12-05 22:12:41
问题 At my current employer we use Ant to execute our build scripts, and I need to add a target to our build.xml file that will start up 4 PHP scripts that are Gearman workers in the background, and then stop those scripts once the build is done. I've looked at the 'parallel' and 'daemons' directives (is that the right word?) but I am not experienced enough with Ant to track down the info I'm missing on how to make sure the script runs in the background. 回答1: As you're not getting many answers I

Gearman, ZF2, Doctrine2, MySQL, SQLSTATE[HY000]: General error: 2006 MySQL server has gone away

杀马特。学长 韩版系。学妹 提交于 2019-12-05 20:55:38
I use ZF2, Doctrine2, MySQL, Gearman. When working Gearman periodically has an error: SQLSTATE[HY000]: General error: 2006 MySQL server has gone away. I tried these steps to fix the problem: 1) I investigated MySQL queries. Queries haven't any problem. It's simple (without subqueries) and fast. For example, this is EXPLAIN of one of queries when MySQL server has gone away. +-------------+-------+-------+-----------------------+-----------------------+---------+-------+------+ | select_type | table | type | possible_keys | key | key_len | ref | rows | +-------------+-------+-------+------------

Installing Gearman PHP extension on Debian 6

你说的曾经没有我的故事 提交于 2019-12-05 19:50:51
I'm desperately trying to get the Gearman PHP extension working on a Debian 6. I have all the binaries and sources root@debian:/tmp/pear/install# aptitude search gearman i gearman - A distributed job queue i A gearman-job-server - Job server for the Gearman i gearman-tools - Tools for the Gearman i libgearman-dev - Development files for the i libgearman4 - Library providing Gearman ...but when there are some bugs in the PHP extension confing which don't let me install it # /usr/local/pear/bin/pecl install gearman downloading gearman-1.1.0.tgz ... Starting to download gearman-1.1.0.tgz (30,488

Valid Architecture for a Message Queue & Worker System in PHP?

限于喜欢 提交于 2019-12-05 16:55:37
问题 I'm trying to wrap my head around the message queue model and jobs that I want to implement in a PHP app: My goal is to offload messages / data that needs to be sent to multiple third party APIs, so accessing them doesnt slow down the client. So sending the data to a message queue is ideal. I considered using just Gearman to hold the MQ/Jobs, but I wanted to use a Cloud Queue service like SQS or Rackspace Cloud Queues so i wouldnt have to manage the messages. Here's a diagram of what I think

gearman issues & php cli

北战南征 提交于 2019-12-05 05:55:35
问题 I'm having some gearman issues when trying to run commands in terminal using php cli. For example I run this command: gearmand --log-file=/var/log/gearman-job-server/gearman.log and get: gearmand: Could not open log file "/usr/local/var/log/gearmand.log", from "/home/jeitnier", switching to stderr. (No such file or directory) ERROR 2013-01-25 16:25:53.000000 [ main ] bind(Address already in use) -> libgearman-server/gearmand.cc:612 ERROR 2013-01-25 16:25:53.000000 [ main ] bind(Transport

Unable to run “gearman” command line tool with gearman 1.1.6

元气小坏坏 提交于 2019-12-04 19:25:20
I am trying to run the example on " http://gearman.org/getting_started " on Ubuntu in VirtualBox environment. At first I tried to download an old version 0.16 by using apt-get install gearman-job-server , apt-get install gearman-tools and everything worked well. The server ran in the background, I was able to create 2 workers and verify that I can call them by creating a client. I decided to download and compile the latest version, 1.1.6 . Now, I am trying to do the same thing with the new version and I am having errors. I run the server as admin: sudo gearmand The statement gearadmin --getpid

Error conditions and retries in gearman?

血红的双手。 提交于 2019-12-04 17:16:10
问题 Can someone guide me on how gearman does retries when exceptions are thrown or when errors occur? I use the python gearman client in a Django app and my workers are initiated as a Django command. I read from this blog post that retries from error conditions are not straight forward and that it requires sys.exit from the worker side. Has this been fixed to retry perhaps with sendFail or sendException? Also does gearman support retries with exponentials algorithm – say if an SMTP failure

Simple scalable work/message queue with delay

谁都会走 提交于 2019-12-04 05:16:50
I need to set up a job/message queue with the option to set a delay for the task so that it's not picked up immediately by a free worker, but after a certain time (can vary from task to task). I looked into a couple of linux queue solutions (rabbitmq, gearman, memcacheq), but none of them seem to offer this feature out of the box. Any ideas on how I could achieve this? Thanks! I've used BeanstalkD to great effect, using the delay option on inserting a new job to wait several seconds till the item becomes available to be reserved. If you are doing longer-term delays (more than say 30 seconds),

Running PHP script in background using Ant

送分小仙女□ 提交于 2019-12-04 03:11:42
At my current employer we use Ant to execute our build scripts, and I need to add a target to our build.xml file that will start up 4 PHP scripts that are Gearman workers in the background, and then stop those scripts once the build is done. I've looked at the 'parallel' and 'daemons' directives (is that the right word?) but I am not experienced enough with Ant to track down the info I'm missing on how to make sure the script runs in the background. As you're not getting many answers I'll suggest a low tech method that might get you start... Use an ant exec task to fire off 4 background php