Skip to main content

mqsrv

mqsrv is a message queue-based Remote Procedure Call (RPC) and event publish/subscribe system. It provides a flexible framework for building distributed systems and microservice architectures.

Features

  • Supports both synchronous and asynchronous RPC calls
  • Event publishing and subscription mechanism
  • Connection pool management
  • Exception handling
  • Flexible serialization options
  • Concurrent processing based on greenthread

Installation

pip install mqsrv

Quick Start

RPC Example

Server Side

from mqsrv.server import make_server, run_server

def hello(name):
    return f"Hello, {name}!"

server = make_server(conn='amqp://guest:guest@localhost:5672//', 
                     rpc_routing_key='rpc_queue')
server.register_rpc(hello)

run_server(server)

Client Side

from mqsrv.client import make_client

client = make_client(conn='amqp://guest:guest@localhost:5672//')
caller = client.get_caller('rpc_queue')

error, result = caller.hello('World')
print(result)  # Output: Hello, World!

Event Example

Subscriber

from mqsrv.server import make_server, run_server

def handle_user_registered(evt_type, evt_data):
    print(f"New user registered: {evt_data['username']} (ID: {evt_data['user_id']})")

server = make_server(conn='amqp://guest:guest@localhost:5672//', 
                     event_routing_keys=['event_queue'])
server.register_event_handler('user_registered', handle_user_registered)

run_server(server)

Publisher

from mqsrv.client import make_client

client = make_client(conn='amqp://guest:guest@localhost:5672//')
publisher = client.get_pubber('event_queue')

publisher('user_registered', {'user_id': 123, 'username': 'john_doe'})

License

This project is licensed under the MIT License.

Metadata

Release files for mqsrv 0.1.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for mqsrv 0.1.3
File Size Uploaded Provenance
mqsrv-0.1.3.tar.gz 9.8 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for mqsrv 0.1.3
File Interpreter ABI Platform
mqsrv-0.1.3-py3-none-any.whl Python 3 none any Details

Total release size: 20.1 kB

Release files / mqsrv-0.1.3.tar.gz

Download URL mqsrv-0.1.3.tar.gz
Size 9.8 kB
Tags Source
SHA-256 checksum
How to use checksums
3728bcbb2118e4a5cca5aff2de141b60518abdbc4c020dd256bc71337394821d
BLAKE2b-256 checksum
How to use checksums
0cf541946d0e8f385c1a2f67edb02b7ec6a55971d9778074a3ecae98893f5546
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.9.19

Release files / mqsrv-0.1.3-py3-none-any.whl

Download URL mqsrv-0.1.3-py3-none-any.whl
Size 10.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2b68350e2d3a7d57e0263a98ab3da5a15a42b111abcd6b4aee394800e45de2c2
BLAKE2b-256 checksum
How to use checksums
c5e17cdf595109325d4ea971c8ab9b3288cf817ca519573d6488a63ec01c2b7d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.9.19

Security for mqsrv 0.1.3

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.

Release history Release notifications | RSS feed

This release

0.1.3 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page