Skip to main content

A remote process launcher.

Project description

Build Status Coverage Status Code Climate Issue Count Documentation Status

yassh

Yassh is a python library used to run asynchronous, dependent remote and local tasks.

Usage

import logging
from yassh import Reactor, RemoteRun, LocalRun

logging.basicConfig(level=logging.DEBUG)

r = Reactor()
c1 = RemoteRun(r, 'localhost', 'user', 'sleep 5')
c2 = LocalRun(r, 'echo ok')
c3 = RemoteRun(r, 'localhost', 'user', 'echo "finished" && sleep 1')


def start_c2():
    # Start cmd2 when cmd1 complete
    c2.start()
c1.register_exit_monitor(start_c2)


def start_c3():
    # Start cmd3 when cmd2 complete
    c3.start()
c2.register_monitor(u'ok', start_c3)


def on_c3_finished():
    # Print dummy message when c3 is near terminaison
    print('c3 almost finished')
c3.register_monitor(u'finished', on_c3_finished)


# Start first task
c1.start()


# Infinite
timeout = -1
while r.run(timeout) > 0:
        pass

Installation

To install latest release:

pip install yassh

To install latest code:

pip install git+https://github.com/enyx-opensource/yassh.git

Testing

Run from project root:

behave

License

MIT License (see LICENSE)

Project details


Download files

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

Source Distribution

yassh-1.0.0.tar.gz (5.8 kB view details)

Uploaded Source

Built Distribution

yassh-1.0.0-py2.py3-none-any.whl (10.0 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file yassh-1.0.0.tar.gz.

File metadata

  • Download URL: yassh-1.0.0.tar.gz
  • Upload date:
  • Size: 5.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for yassh-1.0.0.tar.gz
Algorithm Hash digest
SHA256 86fbce541aa4b044c97db40d73fbcc9a3e1c732d84afcb33381241d025c1349a
MD5 3d2f8fe5a649afe884df31d86e361657
BLAKE2b-256 62ca4082605d3c5665c407c6d708800d42b52a63b5904ea675deae31ce901590

See more details on using hashes here.

File details

Details for the file yassh-1.0.0-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for yassh-1.0.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 d3a8c61dea18444313fd9caa6afcc2eb829748f598137a388835873f02c0155a
MD5 e3c8bda850d34af0350ad76222cde076
BLAKE2b-256 5f4ebac7ba3b2e9626b14050b2e33e87e18e110533c187a97f10fe5d226b8cdb

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page