Skip to main content

A new protocol for SDSS actors.

Project description

Python Versions PyPI version Build Status Documentation Status Coverage Status

CLU implements a new protocol for SDSS actor while providing support for legacy-style actor.

Features

  • Asynchronous API based on asyncio.
  • New-style actor with message passing based on AMQP and RabbitMQ.
  • Legacy-style actor for TCP socket communication via tron.
  • Tools for device handling.
  • Messages are validated JSON strings.
  • click-enabled command parser.

Warning

CLU is under active development and it must be considered in beta stage. The API is changing quickly and breaking changes are frequent.

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 .

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for sdss-clu, version 0.5.1
Filename, size File type Python version Upload date Hashes
Filename, size sdss_clu-0.5.1-py3-none-any.whl (119.0 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size sdss-clu-0.5.1.tar.gz (106.6 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page