`pshub` is a lightweight Python framework that partially implements Publish/Subscribe messaging paradigm.
It utilizes `asyncio` library to support concurrent requests handling. The Python version that we recommend is 3.5+ .
## Name
The name `pshub` indicates the three main components of this library — Pub, Sub and Hub.
## Usage
You can refer to the three example files under directory `examples/`.
## Cheatsheet
### Rule
#### Example
`{"level": {">=": 1, "<": 10}, "message_body": {"contains": "ERROR"}}`
#### Valid Operators
- `contains`
- `<`
- `<=`
- `>`
- `>=`
- `=`
- `!=`
- `excludes`
### Message
#### Example
`{"level": 2, "message_body": "ERROR occurs"}`
## Caveats
- All messages/rules should be Python `dict` whose keys and values are primitive Python type (int, string, etc.)
- The second parameter of the constructor of `PubProtocol`, `msg_gen`, should has following method:
```python
class MessageGenerator(object):
def next(self, loop):
"""
Return next message
Stop the loop if there's no message to publish.
"""
pass
```
## License
Plumbum - A Pub/Sub framework implemented in Python
Copyright (C) 2016 caizixian, lwher
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published
by the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
Metadata
Release files for pshub 0.0.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 | Actions |
|---|---|---|---|---|
| pshub-0.0.2.tar.gz | 4.4 kB | Without provenance | Details for pshub-0.0.2.tar.gz |
Release files / pshub-0.0.2.tar.gz
| Download URL | pshub-0.0.2.tar.gz |
|---|---|
| Size | 4.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
4bcb51749002ba0b26a497896b066431391e03dd661ea2d5d9312e94b97d0260
|
|
BLAKE2b-256 checksum How to use checksums |
3db2d37e2a41e06337c8fa6f7e89beac28828a04911ddc54dbbc45087e6f20f0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for pshub 0.0.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.
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.