Skip to content
This repository has been archived by the owner on Feb 13, 2020. It is now read-only.

Add ability to set timeout for reservations #11

Merged
merged 1 commit into from
Sep 29, 2017

Conversation

kamazan
Copy link
Contributor

@kamazan kamazan commented Sep 29, 2017

Hi,

Related to #8.
I added an option into for worker:run commands to be able to set the timeout value and possibly wait forever for a job.

@pkruithof
Copy link
Contributor

I don't think this works the way you expect it to, see https://github.com/pda/pheanstalk/blob/master/src/PheanstalkInterface.php#L219-L222:

  • A timeout value of 0 will cause the server to immediately return either a
  • response or TIMED_OUT. A positive value of timeout will limit the amount of
  • time the client will block on the reserve request until a job becomes
  • available.

it seems that a response would be immediately returned, instead of (potentially) waiting forever.

@kamazan
Copy link
Contributor Author

kamazan commented Sep 29, 2017

It's not documented at all in the pheanstalk library but the Pheanstalk instance runs forever when a timeout below 0 is given.

@pkruithof pkruithof merged commit ca5196f into treehouselabs:master Sep 29, 2017
@pkruithof
Copy link
Contributor

Thanks!

@mikrahub mikrahub mentioned this pull request Oct 11, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants