CLU’s documentation¶
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
andopscore
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
andopscore
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
andopscore
, 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.
Contents¶
- Changelog
- 2.2.7 - May 20, 2024
- 2.2.6 - March 26, 2024
- 2.2.5 - March 19, 2024
- 2.2.4 - February 26, 2024
- 2.2.3 - January 20, 2024
- 2.2.2 - November 10, 2023
- 2.2.1 - November 10, 2023
- 2.2.0 - August 25, 2023
- 2.1.3 - July 27, 2023
- 2.1.2 - July 20, 2023
- 2.1.1 - July 13, 2023
- 2.1.0 - June 21, 2023
- 2.0.2 - May 24, 2023
- 2.0.2b1 - May 23, 2023
- 2.0.1 - March 12, 2023
- 2.0.0 - March 10, 2023
- 2.0.0b2 - March 10, 2023
- 2.0.0b1 - March 10, 2023
- 1.9.2 - January 24, 2022
- 1.9.1 - December 2, 2022
- 1.9.0 - October 19, 2022
- 1.8.2 - September 15, 2022
- 1.8.1 - September 1, 2022
- 1.7.0 - August 14, 2022
- 1.6.2 - May 25, 2022
- 1.6.1 - May 11, 2022
- 1.6.0 - April 25, 2022
- 1.5.8 - February 10, 2022
- 1.5.7 - February 5, 2022
- 1.5.6 - January 6, 2022
- 1.5.5 - December 14, 2021
- 1.5.4 - November 26, 2021
- 1.5.3 - November 26, 2021
- 1.5.2 - November 7, 2021
- 1.5.1 - November 6, 2021
- 1.5.0 - October 12, 2021
- 1.4.0 - September 27, 2021
- 1.3.0 - September 17, 2021
- 1.2.1 - June 20, 2021
- 1.2.0 - June 3, 2021
- 1.1.2 - May 31, 2021
- 1.1.1 - May 30, 2021
- 1.1.0 - May 29, 2021
- 1.0.3 - May 20, 2021
- 1.0.2 - May 18, 2021
- 1.0.1 - May 16, 2021
- 1.0.0 - May 12, 2021
- The Pre-history
- GitHub Repository
- Issues