This release is a pre-release and may not be stable for production use.
WIP: miPubSub
Publish/Subscribe pattern build with RabbitMQ and Protocol Buffers.
Installation
To install miPubSub, use pipenv (or pip):
$ pipenv install -e git@github.com:azylinski/miPubSub.git@master#egg=miPubSub
Run RabbitMQ
In order to use miPubSub, you need to have access to RabbitMQ server. To setup locally with docker:
docker run -d \
--name demo-rabbit \
-p 5672:5672 \
-p 15672:15672 \
rabbitmq:3.6.15-management-alpine
Define events structure
# schemas/events/user.proto
syntax = "proto3";
package events;
message User {
string name = 1;
string email = 2;
}
# compile proto files
protoc -I=schemas/events/ --python_out=proto/ schemas/events/*.proto
Example
# producer.py
from miPubSub import PubSub
from proto.user_pb2 import User
ps = PubSub('user_management')
u = User(name='Adam West', email='adam.west@mail.com')
ps.publish('signup_completed', u)
# consumer.py
from miPubSub import PubSub
from proto.user_pb2 import User
ps = PubSub('mailer')
@ps.listen('signup_completed', User)
def on_signup_completed(user):
# Send welcome email to: user.email
pass
ps.run()
How it works
TBD
More details on rabbitmq pub/sub: https://www.rabbitmq.com/tutorials/tutorial-three-python.html
License
This project is licensed under the MIT License - see the LICENSE file for details
Metadata
Release files for miPubSub 0.1.dev1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| miPubSub-0.1.dev1-py2.py3-none-any.whl | Python 2, Python 3 | none | any | Details for miPubSub-0.1.dev1-py2.py3-none-any.whl |
Release files / miPubSub-0.1.dev1-py2.py3-none-any.whl
| Download URL | miPubSub-0.1.dev1-py2.py3-none-any.whl |
|---|---|
| Size | 5.7 kB |
| Tags | Python 2 Python 3 |
|
SHA-256 checksum How to use checksums |
a44600835792fc378d3ab7614e2e5e41a0423fc585316a38e2ddb73113c12548
|
|
BLAKE2b-256 checksum How to use checksums |
99436efd5c80a1a28ba4aff903228014aa06d1ebc6729f7a83570ecab73afdd7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for miPubSub 0.1.dev1
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.