pystalk ChangeLog¶
0.9.3¶
Add
pystalk.connect_beanstalk_pool()(also available aspystalk.connect_beanstalk()), a helper that builds apystalk.pool.ProductionPoolfrom a comma-separated list of beanstalkd URLs (read from theBEANSTALKD_URLSenvironment variable by default) with sensible defaults (3s socket timeout, 1s connect timeout, 10s backoff).Returns a pool, not a client.
connect_beanstalk()andconnect_beanstalk_pool()return aProductionPoolforput_job/put_job_intoonly. They are not a drop-in replacement for theconnect_beanstalk()helpers in billing, payment, subscription-processor, or awstoken, which return aBeanstalkClient. Prefer theconnect_beanstalk_poolname.connect_beanstalkis an alias kept so existing imports of this function keep working.Add
pystalk.parse_beanstalk_urls(), which normalizes a comma-separated string or iterable of beanstalkd URLs (stripping whitespace and quotes, dropping empty entries, and prepending thebeanstalk://scheme when missing).Add
pystalk.pool.ProductionPool.from_env(), which constructs a pool from URLs read from an environment variable using the same logic aspystalk.connect_beanstalk_pool().pystalk.NoMoreClients(alsopystalk.pool.NoMoreClients) is now a subclass ofBeanstalkErrorand is exported frompystalk.except NoMoreClientsstill catches it, and so doesexcept BeanstalkError. CatchNoMoreClientsfirst if you need to tell “every host failed” apart from a protocol error. It is still raised with no arguments andstr()is unchanged.
0.9.2¶
Behavior change:
OSErrorraised while sending or receiving a command (includingsocket.timeout,TimeoutError,ConnectionResetError, andBrokenPipeError) is now wrapped inpystalk.client.BeanstalkConnectionError, chained from the original error (also preserved onerr).BeanstalkConnectionErroris aBeanstalkError, not anOSError.except OSErrorandexcept socket.timeoutaround pystalk calls no longer catch these failures; catchBeanstalkConnectionErrororBeanstalkErrorinstead.Close the socket and reset client state on any connection-level error, and on any other exception that interrupts a command (for example
KeyboardInterrupt, a timeout raised by another library, or a response parse error), so the next call reconnects and restoresUSE/WATCHinstead of reading a stale reply. A normal protocolBeanstalkErrorstill leaves the socket open.pystalk.pool.ProductionPool.put_job()andput_job_into()pass the caller’sttrthrough. Previously both methods ignored it and storedttr=120.Treat a
DRAININGresponse as retriable inProductionPool, so a host drained for maintenance fails over to the next server.Add optional
connect_timeoutparameter topystalk.client.BeanstalkClient,pystalk.client.BeanstalkClient.from_uri(),pystalk.client.BeanstalkClient.ping(), andpystalk.pool.ProductionPool.from_uris()(defaulting tosocket_timeoutwhen unset) so connection establishment can use a shorter timeout than socket I/O.
0.9.1¶
Raise
pystalk.client.BeanstalkConnectionErrorwhen an established connection is closed by beanstalkd.
0.9.0¶
Drop support for Python < 3.9
Fix
pystalk.client.BeanstalkClient.put_job()to compute put payload length from UTF-8 encoded bytes, preventing EXPECTED_CRLF errors for non-ASCII job bodies.
0.8.1¶
Fix
pystalk.pool.ProductionPoolfailover and backoff behavior so connection failures try each available server once before raisingpystalk.pool.NoMoreClients.
0.8.0¶
Add
pystalk.client.BeanstalkConnectionError, a subclass ofpystalk.client.BeanstalkErrorraised when the underlying socket connection to beanstalkd fails (connection refused, timeout, or DNS errors), distinguishing connection-level failures from beanstalk protocol errors. Carries the host and port that were being connected to, and preserves the original socket error onerr.Add
pystalk.client.BeanstalkClient.ping()to test connectivity without changing the client’s active connection, current tube, or watchlist.Remove the legacy
sixcompatibility dependency.
0.7.0¶
Drop support for Python < 3.6
Add pystalk.pool.ProductionPool
Add some typing annotations
0.6.1¶
More emphatically remove tests from distributed packages
0.6.0¶
add compatibility for attrs 19.2.0 and above
drop support for Python 3.3.x
0.5.1¶
attrs changed a kwarg from convert to converter
0.5.0¶
Move tests from CircleCI to Travis-CI
Add
pystalk.client.BeanstalkClient.from_uri()to create a BeanstalkClient instance from a URI/URL
0.4.0¶
Add
pystalk.client.BeanstalkClient.peek_ready_iter()mirroring peek_delayed_iter and peek_buried_iterAdd
pystalk.client.BeanstalkClient.kick_job()to kick a single job by ID
0.3.1¶
Fix crash when setting socket_timeout to None
0.3.0¶
Add
pystalk.client.BeanstalkClient.using()andpystalk.client.BeanstalkClient.put_job_into()as clearer APIs for inserting jobsRe-establish USE and WATCH on close/re-open
0.2.1¶
Add
pystalk.client.BeanstalkClient.close()method to thepystalk.client.BeanstalkClientclassAdd a plethora of new and fixed docstrings
Start hosting docs at http://pystalk.readthedocs.io
0.2¶
Initial release