Giter Site home page Giter Site logo

pytask-io's Introduction

PyPI Read the Docs GitHub

Asynchronous Tasks Library using asyncio

An Asyncio based task queue that is designed to be super easy to use!

Read the docs: Documentation

PyTask IO

Install

pip install pytask-io

docker run redis  # Rabbit MQ coming soon...

Usage

    from pytask_io import PyTaskIO
    
    # Starts the task runner
    pytask = PytaskIO(
        store_port=6379,
        store_host="localhost",
        db=0,
        workers=1,
    )
    
    # Start the PytaskIO task queue on a separate thread.
    pytask.run()
    
    # Handle a long running process, in this case a send email function
    metadata = pytask.add_task(send_email, title, body)
    
    # Try once to get the results of your email sometime in the future
    result = pytask.get_task(metadata)
    
    # Later we can use the `metadata` result to pass to `add_task`
    result = pytask.poll_for_task(metadata, tries=100, interval=60)
    
    # Stop PytaskIO completely (This will not affect any units of work that haven't yet executed)
    pytask.stop()

Compatible task types

PyTaskIO will always return back the task meta data. Do not embed Python objects of type frame, generator, traceback & context objects. In this case you will get back the exception thrown when PyTaskIO attempts to execute the serialization.

Authors

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

License

MIT

pytask-io's People

Contributors

0xd4n10 avatar cinaaaa avatar creatorrr avatar dependabot[bot] avatar joegasewicz avatar martinleblanc avatar piotr-kopacki avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

pytask-io's Issues

Mixed licenses

mixed licenses there, LICENSE.txt is GPLv3 but README says it's MIT

(thanks to u/cetme308 on reddit)

PytaskIO incorrect import path

Currently to install PyTaskIO class we need to import like

from pytask_io.pytask_io import PyTaskIO

But we should have:

from pytask_io import PyTaskIO

Add init method

To make PyTaskIO class DI compatible add the following:

    def init(self, **kwargs):
        """
        :param kwargs:
        :return:
        """
        self.store_host = kwargs.get("store_host") or self.store_host
        self.store_port = kwargs.get("store_port") or self.store_port
        self.store_db = kwargs.get("store_db") or self.store_db
        self.workers = kwargs.get("workers") or self.workers

Low level logging variable not in Readme or docs

The low level logging variable PYTASKIO_DEBUG is not in the Readme or docs.

example should read:

# For development of low level libraries, you can get debug level logging with:
export PYTASKIO_DEBUG=1

Later we can add in a kwarg to the main class for high level users...

Lets build this together!!

I need your help to build this amazing new library .. no more complex , bloated task runners... lets get this right!

Please submit issues .. pullrequests .. let's start building together , today!

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.