Romeways
This project has as goal help developers to not reimplemented default queue consumer behaviour.
Basics
Romeways works with two basic concepts queue handler and queue connector. The queue connector is a queue consumer and can be spawned in a separate process or in async worker. The queue handler is the callback function that will be called for each retrieved message.
Here you can see all implemented consumer:
| Queue Type | Install using extra | description |
|---|---|---|
| multiprocessing.Queue | memory | here |
| Apache Kafka | kafka | here |
How to install extra packages?
poetry add romeways -E memory
OR
pip install 'romeways[memory]'
Configuration
Queue connector config
The queue connector config is all configurations that you need to be able to retrieve messages from the queue.
Bellow are the romeways.GenericConnectorConfig implementation. This class can be inheritance to allow extra configurations.
Params:
connector_name: strFor what connector this queue must be delivered
from dataclasses import dataclass
@dataclass(slots=True, frozen=True)
class GenericConnectorConfig:
"""
connector_name: str Connector name
"""
connector_name: str
Queue handler config
When you register a queue consumer you are setting configs and a callback handler for each message that this queue receives.
Bellow are the romeways.GenericQueueConfig implementation. This class can be inheritance to allow extra configurations.
Params:
connector_name: strFor what connector this queue must be deliveredfrequency: floatTime in seconds for retrieve messages from queuemax_chunk_size: intMax quantity for messages that one retrieve will getsequential: boolIf the handler call must be sequential or in asyncio.gather
from dataclasses import dataclass
@dataclass(slots=True, frozen=True)
class GenericQueueConfig:
"""
connector_name: str For what connector this queue must be delivered
frequency: float Time in seconds for retrieve messages from queue
max_chunk_size: int Max quantity for messages that one retrieve will get
sequential: bool If the handler call must be sequential or in asyncio.gather
"""
connector_name: str
frequency: float
max_chunk_size: int
sequential: bool
Resend on error
Romeways allow you to resend the message to the queue if something in your handler do not perform correctly. For that your code need tho raise the romeways.ResendException exception, the message will be resent to the same queue and the romeways.Message.rw_resend_times parameter will be raized
Spawn a process
Romeways can run each connector in a separate process or in async workers for that use the parameter spawn_process to configure that.
Example
For this example we are using the extra package memory
from multiprocessing import Queue
import romeways
# Config the connector
queue = Queue()
# Create a queue config
config_q = romeways.MemoryQueueConfig(
connector_name="memory-dev1",
queue=queue
)
# Register a controller/consumer for the queue name
@romeways.queue_consumer(queue_name="queue.payment.done", config=config_q)
async def controller(message: romeways.Message):
print(message)
config_p = romeways.MemoryConnectorConfig(connector_name="memory-dev1")
# Register a connector
romeways.connector_register(
connector=romeways.MemoryQueueConnector, config=config_p, spawn_process=True
)
Metadata
Release files for rome-ways 0.2.2
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 | |
|---|---|---|---|---|
| rome_ways-0.2.2.tar.gz | 15.1 kB | With provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| rome_ways-0.2.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 43.0 kB
Release files / rome_ways-0.2.2.tar.gz
| Download URL | rome_ways-0.2.2.tar.gz |
|---|---|
| Size | 15.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
4bcd2fa4f4998d3c867f7fd57586bad0ac2c0efac5727d9d150eea2ff7f2b976
|
|
BLAKE2b-256 checksum How to use checksums |
3f16cad1482aeae82fcaa9457ee5255df739e538e151127f0a6c226825fb2e6c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jul 30, 2026.
Transparency logRelease files / rome_ways-0.2.2-py3-none-any.whl
| Download URL | rome_ways-0.2.2-py3-none-any.whl |
|---|---|
| Size | 27.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
2b105da4a4750f41906b7c9784c42b09edb521ca911f58abc8b377461835c9ec
|
|
BLAKE2b-256 checksum How to use checksums |
ccf012308ddbe15ce1eed74eb05c7499dafe1ca73057ca515f2e23ad6ebf5c77
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jul 30, 2026.
Transparency logSecurity for rome-ways 0.2.2
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.
Full provenance
All 2 files in this release have been uploaded with provenance metadata.
Attestation for rome_ways-0.2.2.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jul 30, 2026.
Transparency logA 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.