Commit Graph

11 Commits

Author SHA1 Message Date
Kyle Vigen
8cdaef9752 Ability to exit work loop gracefully
This change adds the ability to call Shutdown on a gearman-go worker which causes the
worker to wait for all currently active jobs to finish and then close the connection.

It does this by keeping tracking of the number of currently active transactions, disallowing
new job creation, and using a WaitGroup to wait for all active jobs to finish.
2014-06-10 14:48:35 -07:00
Joe Higton
0a4489d1fe Fixed and improved Work() without Ready() test:
* FIX: committed test froze
* FIX: committed test had a race condition!
* Added properly handled panic test
* Timeouts so that these tests should fail now if something goes wrong instead of failing.
2014-06-04 13:31:25 +01:00
draxil
6688c29c37 Enahanced Work() without Ready() behaviour:
Now if you try to call Work() without calling Ready(), it will trigger an attempt to run Ready(), and will only panic if there is an error.
2014-06-01 16:59:57 +01:00
Xing Xing
bf25cc1728 a better documents for the client package 2013-12-26 15:28:42 +08:00
Xing Xing
18791d0490 a better documents 2013-12-26 12:06:47 +08:00
Xing Xing
2ee2be0891 go fmt 2013-12-23 17:05:42 +08:00
Xing Xing
2b4cc002d1 grab, no_job, pre_sleep, noop 2013-12-23 17:01:01 +08:00
Xing Xing
e5179e3b5b started refactoring worker 2013-08-30 18:01:10 +08:00
Xing Xing
124e686699 go fmt 2013-08-30 12:36:57 +08:00
mikespook
f14964bc81 add timeout to client.Do 2012-05-24 19:21:30 +08:00
mikespook
7614c2678a make a new branch, refactoring codes
--HG--
branch : 0.1
rename : gearman/client/client.go => client/client.go
rename : gearman/client/client_test.go => client/client_test.go
rename : gearman/client/clientjob.go => client/job.go
rename : gearman/gearman.go => common/gearman.go
rename : gearman/worker/jobagent.go => worker/jobagent.go
rename : gearman/worker/worker.go => worker/worker.go
rename : gearman/worker/worker_test.go => worker/worker_test.go
rename : gearman/worker/workerjob.go => worker/workerjob.go
2012-05-22 20:05:39 +08:00