Giter VIP home page Giter VIP logo

usian's Introduction

usain

A native fast lightweight task scheduler framework and background jobs

Build Status

Installation

pip install usian

Usage

from usain import Task, Runner


t1 = Task('test-task',
        pipe=[
            lambda x: x + 1,
            lambda x: x ** 2,
            lambda x: print(x)
        ],
        init_data=1
)

runner = Runner()

runner.add(t1, 3)

if __name__ == "__main__":
    runner.run() # will run in the background
    print('hello usain') # will be printed while the task running

'''

| INFO     | usain.usain:_run_job:61 -
| INFO     | usain.usain:_run:34 - Running pipeline for task test-task with intial data
hello usain
| DEBUG    | usain.usain:_run:35 - Task test-task running at node 1 out of 3
| DEBUG    | usain.usain:_run:38 - Task test-task running at node 2 out of 3
| DEBUG    | usain.usain:_run:38 - Task test-task running at node 3 out of 3
4
| INFO     | usain.usain:_run_job:61 -
| INFO     | usain.usain:_run:34 - Running pipeline for task test-task with intial data
| DEBUG    | usain.usain:_run:35 - Task test-task running at node 1 out of 3
| DEBUG    | usain.usain:_run:38 - Task test-task running at node 2 out of 3
| DEBUG    | usain.usain:_run:38 - Task test-task running at node 3 out of 3
4
'''
# will keep going

Features

  • Simple Task Pipelines

  • Non-blocking background tasks

  • Multithreading Task Runner

  • Exception handling

  • Minimal Interface

  • Background jobs

  • Non-blocking runner

  • Add new tasks on runtime

TODO

  • Depndancy control in Runner/Task

  • Use multiple interval unit than seconds (already supported in schedule)

  • Task pipeline retry on fail

  • Task visualization dashboard

  • Custome logging

  • Tasks shared memory

Free software: MIT license

Credits

This package was created with Cookiecutter_ and the audreyr/cookiecutter-pypackage_ project template.

.. _Cookiecutter: https://github.com/audreyr/cookiecutter .. _audreyr/cookiecutter-pypackage: https://github.com/audreyr/cookiecutter-pypackage

usian's People

Contributors

adhaamehab avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.