Swarm-Bus
Client side implementation of an ESB with Amazon SQS.
Simple Usage
# Default transport config
transport = {
'prefix': 'dev-%(hostname)s-',
'priorities': ['low', 'medium', 'high'],
'polling_interval': 20, # Default queue polling interval
'retention_period': 864000, # Default queue retention period
'visibility_timeout': 30, # Default queue visibility timeout
'sleep_time': 0, # Default queue sleep time
'region': 'eu-west-1'
}
bus = SwarmBus('LOGIN', 'PASSWORD', **transport)
bus.connect()
queue_config = {
'visibility_timeout': 5
}
# Now we register a new queue
bus.register_queue('new_queue', **queue_config)
# Disconnect the bus to finish
bus.disconnect()
Using as a producer
with SwarmBus('LOGIN', 'PASSWORD', **transport) as producer:
producer.register_queue('new_queue')
producer.publish(
'new_queue',
{'id': 42}
)
producer.publish(
'new_queue',
{'id': 84},
priority=1, # Priority index, correspond to 'medium'
delay=5 # Delay of the message
)
Using as a consumer
def handle_message(body, message):
print(body)
message.delete()
def error_handler(body, message):
raise ValueError('Error while processing message')
with SwarmBus('LOGIN', 'PASSWORD', **transport) as consumer:
consumer.register_queue('new_queue')
consumer.consume(
'new_queue',
handle_message,
error_handler
)
Metadata
Release files for swarm-bus 5.18
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| swarm-bus-5.18.tar.gz | 7.4 kB | Without provenance | Details for swarm-bus-5.18.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| swarm_bus-5.18-py3-none-any.whl | Python 3 | none | any | Details for swarm_bus-5.18-py3-none-any.whl |
Total release size: 16.5 kB
Release files / swarm-bus-5.18.tar.gz
| Download URL | swarm-bus-5.18.tar.gz |
|---|---|
| Size | 7.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
65b54ed607eec86457666afeb940e7148198a76359be780ca12e2f4df9a765a7
|
|
BLAKE2b-256 checksum How to use checksums |
d0d29005e3f13cddf9b36315de7ec575fb3639bcb189d0467e556df4b41c1a55
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.12.1 pkginfo/1.4.2 requests/2.18.4 setuptools/36.5.0 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/2.7.12
|
Release files / swarm_bus-5.18-py3-none-any.whl
| Download URL | swarm_bus-5.18-py3-none-any.whl |
|---|---|
| Size | 9.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
2769428d29ceb2694b316185c00a9735af71abc146efe787871d9975d126b4fc
|
|
BLAKE2b-256 checksum How to use checksums |
f6e601fe536334d8f7ce1d8653231727f1659b1caa7cdf81f4500b9510995347
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.12.1 pkginfo/1.4.2 requests/2.18.4 setuptools/36.5.0 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/2.7.12
|
Security for swarm-bus 5.18
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.