A Python 3 asyncio client for the beanstalkd work queue
Project description
aiostalk is a small and shameless Python client library for communicating with the beanstalkd work queue.
It is based on (and requires) another library called greenstalk by Justin Mayhew.
Getting Started
Presuming beanstalkd running on localhost at standard port.
>>> import asyncio
>>> import aiostalk
>>>
>>> async def main():
... client = aiostalk.Client(('127.0.0.1', 11300))
... await client.connect()
... job_id = await client.put('hello')
... print(job_id)
... job = await client.reserve()
... print(job.id)
... print(job.body)
... await client.delete(job)
... await client.close()
>>>
>>> asyncio.run(main())
1
1
hello
Using the Client as an asyncio context manager is also supported.
Documentation
Please see greenstalk docs at Read the Docs.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
aiostalk-1.3.tar.gz
(5.3 kB
view hashes)
Built Distribution
aiostalk-1.3-py3-none-any.whl
(5.3 kB
view hashes)