Skip to main content

A simple queue service using Amazon SQS and boto

Project description

pysqes
======

Simple queue service for python using SQS and boto.

Usage
======
In order to create a task you can use the SQSTask class to create
an instance that include a function decorator which can be sent
to the queue when you run the delay method that will be added
to the function. The delay function takes the parameters that will
be used by the worker when it actually executes the task.

```python
from boto.sqs.connection import SQSConnection

from pysqes.task import Task

conn = SQSConnection('ACCESS_KEY', 'SECRET_KEY')
queue = Queue(conn, 'pysqes_test', backend=backend)

def add(a, b):
return a + b

# this will submit a job to the queue
queue.enqueue(add_func, 1, 2)
```

You can run the task by using the work method included in the
SQSWorker class, all you need to do is create a worker instance.
```python
from boto.sqs.connection import SQSConnection

from pysqes.runners.gevent_runner import GeventRunner
from pysqes.worker import Worker

conn = SQSConnection('ACCESS_KEY', 'SECRETE_KEY')
runner = GeventRunner()
queue = Queue(conn, 'pysqes_test', backend=backend)
worker = Worker(queue, runner=runner)

worker.work()
```

New in 0.2
======

Worker Runners
=====
Pysqes now supports having different runners, the default one is the
process runner, which will spawn a new a process and run the task in it.
We also have a gevent runner, which you can use by using the gevent flag
in the command line and set the number of threads you would like to have
running.
Note: It has only been tested with gevent 1.0

Command line scripts
=====
Pysqes now comes with command line scripts. The worker command will be the only
one available for this version, but task and peek commands may be coming to 0.3.
```shell
pysqes worker --gevent --workerpath=/home/user/pysqesproj/ --config=pysqesconfig --configpath=/home/user/pysqesproj/settings/
```

Running the tests
======
If you are using python 2.7 you can run the unit tests by
using the new discover runner included in the unittest module:

```shell
python -m unittest discover -s tests
```

or you can just run each unit test individually.


Coming in 0.3
======
* New command line scripts.
* Tests for command line scripts.
* Better logging.

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

pysqes-0.2.tar.gz (12.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pysqes-0.2.macosx-10.9-intel.exe (80.0 kB view details)

Uploaded Source

File details

Details for the file pysqes-0.2.tar.gz.

File metadata

  • Download URL: pysqes-0.2.tar.gz
  • Upload date:
  • Size: 12.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for pysqes-0.2.tar.gz
Algorithm Hash digest
SHA256 e3cdebc5214ba551c2582329eb83b3b396d579b4019aee9a042b5dae89a77e10
MD5 dbcdef2bd40c1a9a7e54f641e7c92df7
BLAKE2b-256 3b38527cf02b1dc9cd28ef607e364e6c7f7fc2e104c56de1ac56fad05ce1501c

See more details on using hashes here.

File details

Details for the file pysqes-0.2.macosx-10.9-intel.exe.

File metadata

File hashes

Hashes for pysqes-0.2.macosx-10.9-intel.exe
Algorithm Hash digest
SHA256 2b2b71e2e9e18171712dc3be555ebdea0c662bbdc998b669b1ecf2e03994abb3
MD5 4de4ad8ca1de6bf29fabb2b9e6269261
BLAKE2b-256 ba07ee6340d6314a1f60f0be9ba8a066caeec568e681faafa98a509d0117c7c8

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page