pheanstalk

PHP client for beanstalkd queue

MIT License

Downloads
23.9M
Stars
1.9K
Committers
48

Bot releases are hidden (Show)

pheanstalk - v4.0.5

Published by SamMousa 9 months ago

What's Changed

New Contributors

Full Changelog: https://github.com/pheanstalk/pheanstalk/compare/v4.0.4...v4.0.5

pheanstalk - Stable v5!

Published by SamMousa about 1 year ago

pheanstalk - v5.0.0-beta.1

Published by SamMousa over 1 year ago

pheanstalk - v5.0.0-alpha2

Published by SamMousa over 2 years ago

Second alpha release.
Documentation still needs significant work, but this code should be working.
Test coverage is very high and we have both unit tests as well as integration tests.

Full Changelog: https://github.com/pheanstalk/pheanstalk/compare/v5.0.0-alpha1...v5.0.0-alpha2

pheanstalk - v5.0.0-alpha1

Published by SamMousa almost 3 years ago

Alpha release of V5, this is an almost complete rewrite so changes in your necessary.

pheanstalk -

Published by SamMousa almost 3 years ago

pheanstalk -

Published by SamMousa about 4 years ago

pheanstalk -

Published by SamMousa about 4 years ago

pheanstalk - Fix TCP keep alive

Published by SamMousa over 4 years ago

This release contains the fix for #205, it was found and fixed by @panicoschr.

pheanstalk - Version 4

Published by SamMousa over 5 years ago

Version 4 of Pheanstalk is a partial rework of the most popular PHP library for Beanstalkd.

This release removes support for persistent connections and removes functions with side effects like putInTube.

To be more flexible in deployment Pheanstalk now supports different socket implementations, if possible it will default to using the sockets extension. Advantage of this extension is that it allows us to enable tcp KEEP ALIVE.

In Pheanstalk one common issue that people ran into was an undetectable connection failure. The consumer would wait infinitely but no new jobs would come in. For a lot of reasons it can be impossible for PHP (or even the underlying OS) to detect that a connection was dropped.
For this reason we recommend always:

  • Use reserve with a timeout set to the maximum time you want a dropped connection to go unnoticed.
  • Catch exceptions and re-instantiate Pheanstalk when needed.

Please test your code thoroughly before deploying version 4 in production. Specifically make sure your code handles exceptions and takes appropriate actions.

pheanstalk -

Published by SamMousa almost 6 years ago

pheanstalk -

Published by SamMousa almost 6 years ago

pheanstalk -

Published by SamMousa about 6 years ago

pheanstalk - Bugfix for socket timeouts

Published by SamMousa about 6 years ago

This release fixes a bug that could, in certain cases, cause data to be lost from a connection.
Due to the way beanstalk reservations work no data is permanently lost and the main effect of this would be a delay in task execution.

Thanks for pointing out the problem @mialex!

pheanstalk - Maintenance release

Published by SamMousa about 6 years ago

This is a maintenance release.

One issue that was fixed in this release was the risk of an infinite loop in Connection::getLine().
Now after a timeout, configurable via ini-set('default_socket_timeout', $timeout), the getLine() function will throw an exception to bring it in line with Connection::read() and Connection::write().

If your worker has to potentially wait a long time for jobs you might start to see exceptions that you did not see before. Even though this behavior is a change it allows you to actually detect errors instead of just waiting forever.

My worker runs via a supervisor

If your worker is currently managed by a supervisor (ie, it restarts after it dies), set your socket timeout to a value like 3600. This means that if the worker doesn't get jobs for 12 hours, it will be restarted 12 times, but in return, if the connection is dead the worker will restart after at most 1 hour and resume working.

My worker does not run via a supervisor

If a crash of your worker results in manually having to restart it you should really change the configuration.
One option that partially resolves this is properly catching errors in reserve(), socket errors are in that sense nothing new, the changes in this version just make them more consistent in certain cases.

pheanstalk - resumeTube(), disconnect(), connectPersistent()

Published by pda about 9 years ago