rosny is a lightweight library for building concurrent systems.
Installation
Tested on:
- Linux
- Python >= 3.8
From pip:
pip install rosny
From source:
pip install git+https://github.com/lRomul/rosny.git@master
Example
from multiprocessing import Queue
from rosny import ThreadNode, ProcessNode, ComposeNode
class SenderNode(ThreadNode): # using threading.Thread
def __init__(self, queue: Queue):
super().__init__(loop_rate=30)
self.queue = queue
self.count = 0
# run the method in a loop in a separate thread
def work(self):
self.queue.put(self.count)
self.logger.info(f'put {self.count}')
self.count += 1
class ReceiverNode(ProcessNode): # using multiprocessing.Process
def __init__(self, queue: Queue):
super().__init__()
self.queue = queue
# run the method in a loop in a separate process
def work(self):
value = self.queue.get(timeout=1)
self.logger.info(f'get {value}')
class MainNode(ComposeNode): # merging several nodes
def __init__(self):
super().__init__()
queue = Queue()
self.sender = SenderNode(queue)
self.receiver = ReceiverNode(queue)
if __name__ == "__main__":
node = MainNode()
node.start()
node.wait(5)
node.stop()
node.join()
Metadata
Release files for rosny 0.1.0
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 | |
|---|---|---|---|---|
| rosny-0.1.0.tar.gz | 12.0 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| rosny-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 22.2 kB
Release files / rosny-0.1.0.tar.gz
| Download URL | rosny-0.1.0.tar.gz |
|---|---|
| Size | 12.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
a4cf2513657cbf9bfb8f75d627d00c87a5353ecf73b3acf6d5c4937ec179ef68
|
|
BLAKE2b-256 checksum How to use checksums |
783a930dad8e27e1d535fc195df3bad3b9128a83e8cf7be2e632b54eff2a217a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.0.0 CPython/3.12.3
|
Release files / rosny-0.1.0-py3-none-any.whl
| Download URL | rosny-0.1.0-py3-none-any.whl |
|---|---|
| Size | 10.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
6af6acbb2c824604f29100635cc779c26e4da3468c7739fdb61bac74ea50f67c
|
|
BLAKE2b-256 checksum How to use checksums |
3eb6f913ec2753083b484734b838d0f27afdd50205b4ec23ff59852908e2ef7f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.0.0 CPython/3.12.3
|
Security for rosny 0.1.0
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.