A new protocol for SDSS actors.
Project description
CLU implements a new protocol for SDSS actor while providing support for legacy-style actor.
Features
Installation
CLU can be installed using pip as
pip install sdss-clu
or from source
git clone https://github.com/sdss/clu
cd clu
pip install .
Development
clu uses poetry for dependency management and packaging. To work with an editable install it’s recommended that you setup poetry and install clu in a virtual environment by doing
poetry install
Pip does not support editable installs with PEP-517 yet. That means that running pip install -e . will fail because poetry doesn’t use a setup.py file. As a workaround, you can use the create_setup.py file to generate a temporary setup.py file. To install clu in editable mode without poetry, do
pip install --pre poetry
pip install -U setuptools
python create_setup.py
pip install -e .
Quick start
Creating a new actor with CLU is easy. To instantiate and run an actor you can simply do
import asyncio
from clu import AMQPActor
async def main(loop):
actor = await Actor('my_actor').start()
await actor.run_forever()
asyncio.run(main(loop))
Next, head to the Getting started section for more information about using actors. More examples are available here.
Why a new messaging protocol for SDSS?
Say whatever you want about it, the current SDSS message passing protocol based on Tron, opscore, and actorcore is stable and robust. So, why should we replace it? Here is a list of reasons:
It reinvents the wheel. Ok, in all honesty Tron and opscore were written when wheel were still not completely circular, but the truth is that nowadays there are more robust, standard, and better documented technologies out there for message passing.
We can remove the need for a central hub product by relying in open-source message brokers such as RabbitMQ.
Tron and opscore are Python 2 and it’s unclear the amount of effort that would be needed to convert them to Python 3.
While there is some documentation for Tron and opscore, and the code is well written, it’s also cumbersome and difficult to modify by people that didn’t write it. It’s ultimately non-maintainable.
The opsctore/actorkeys datamodel is custom-built and extremely difficult to maintain. Standard solutions such as JSON with a JSON schema validator should be preferred.
asyncio provides an asynchronous API that is cleaner and easier to code than using threads. It is also more readable and less convoluted than twisted and it’s a Python core library with very active development.
CLU uses click for parsing commands, providing a well-defined, easy to use parser.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file sdss_clu-2.3.0.tar.gz
.
File metadata
- Download URL: sdss_clu-2.3.0.tar.gz
- Upload date:
- Size: 122.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 162d9dc48a26713ff8e3251b2adad57327b5300bd9539c59f8d34254f46195c6 |
|
MD5 | a22efa154361174d0877c84e1a130645 |
|
BLAKE2b-256 | a4cb21da9fee791f599f94da7815f17dc1e259e4117464b12e4ad06e2706a75c |
Provenance
The following attestation bundles were made for sdss_clu-2.3.0.tar.gz
:
Publisher:
release.yml
on sdss/clu
-
Statement type:
https://in-toto.io/Statement/v1
- Predicate type:
https://docs.pypi.org/attestations/publish/v1
- Subject name:
sdss_clu-2.3.0.tar.gz
- Subject digest:
162d9dc48a26713ff8e3251b2adad57327b5300bd9539c59f8d34254f46195c6
- Sigstore transparency entry: 149975230
- Sigstore integration time:
- Predicate type:
File details
Details for the file sdss_clu-2.3.0-py3-none-any.whl
.
File metadata
- Download URL: sdss_clu-2.3.0-py3-none-any.whl
- Upload date:
- Size: 142.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d71cddd5cb2ee0a7667f10659b839e02eae5196144debda820f25b87d262325a |
|
MD5 | 7c01df48b99efe3545d57cfa841b3984 |
|
BLAKE2b-256 | ee744953daabae81d39361d8dd2fd398024d8a4ab01b4263ba3e7b11d0e57a70 |
Provenance
The following attestation bundles were made for sdss_clu-2.3.0-py3-none-any.whl
:
Publisher:
release.yml
on sdss/clu
-
Statement type:
https://in-toto.io/Statement/v1
- Predicate type:
https://docs.pypi.org/attestations/publish/v1
- Subject name:
sdss_clu-2.3.0-py3-none-any.whl
- Subject digest:
d71cddd5cb2ee0a7667f10659b839e02eae5196144debda820f25b87d262325a
- Sigstore transparency entry: 149975231
- Sigstore integration time:
- Predicate type: