aiojobs | Jobs scheduler for managing background task (asyncio) | Reactive Programming library

 by   aio-libs Python Version: 1.2.1 License: Non-SPDX

kandi X-RAY | aiojobs Summary

kandi X-RAY | aiojobs Summary

aiojobs is a Python library typically used in Programming Style, Reactive Programming applications. aiojobs has no bugs, it has no vulnerabilities and it has low support. However aiojobs build file is not available and it has a Non-SPDX License. You can install using 'pip install aiojobs' or download it from GitHub, PyPI.

Jobs scheduler for managing background task (asyncio)
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              aiojobs has a low active ecosystem.
              It has 708 star(s) with 64 fork(s). There are 17 watchers for this library.
              OutlinedDot
              It had no major release in the last 12 months.
              There are 9 open issues and 51 have been closed. On average issues are closed in 680 days. There are 4 open pull requests and 0 closed requests.
              It has a neutral sentiment in the developer community.
              The latest version of aiojobs is 1.2.1

            kandi-Quality Quality

              aiojobs has 0 bugs and 0 code smells.

            kandi-Security Security

              aiojobs has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.
              aiojobs code analysis shows 0 unresolved vulnerabilities.
              There are 0 security hotspots that need review.

            kandi-License License

              aiojobs has a Non-SPDX License.
              Non-SPDX licenses can be open source with a non SPDX compliant license, or non open source licenses, and you need to review them closely before use.

            kandi-Reuse Reuse

              aiojobs releases are available to install and integrate.
              Deployable package is available in PyPI.
              aiojobs has no build file. You will be need to create the build yourself to build the component from source.
              aiojobs saves you 348 person hours of effort in developing the same functionality from scratch.
              It has 922 lines of code, 128 functions and 9 files.
              It has high code complexity. Code complexity directly impacts maintainability of the code.

            Top functions reviewed by kandi - BETA

            kandi has reviewed aiojobs and discovered the below as its top functions. This is intended to give you an instant insight into aiojobs implemented functionality, and help decide if they suit your requirements.
            • Wrap a coroutine asynchronously
            • Close the job
            • Spawn a new job
            • Wait for this task to finish
            • Close the scheduler
            • Calls the exception handler
            • Wait for the task to finish
            • Start the task
            • Returns a Scheduler instance
            • Spawn a coroutine
            • Get Scheduler from request
            • Called when the task is done
            • Mark the given job as done
            • Report an exception
            • Setup asyncio
            • Close all pending jobs
            Get all kandi verified functions for this library.

            aiojobs Key Features

            No Key Features are available at this moment for aiojobs.

            aiojobs Examples and Code Snippets

            No Code Snippets are available at this moment for aiojobs.

            Community Discussions

            QUESTION

            Aiohttp server max connections
            Asked 2019-May-28 at 14:25

            I cannot understand the reason aiohttp (and asyncio in general) server implementation does not provide a way to limit max concurrent connections limit (number of accepted sockets, or number of running requests handlers). (https://github.com/aio-libs/aiohttp/issues/675). Without this limit, it is easy to run out of memory and/or file descriptors.

            In the same time, aiohttp client by default limits number of concurrent requests to 100 (https://docs.aiohttp.org/en/stable/client_advanced.html#limiting-connection-pool-size), aiojobs limits number of running tasks and size of pending tasks list, nginx has worker_connections limit, any sync framework is limited by number of worker threads by design.

            While aiohttp can handle a lot of concurrent requests, this number is still limited. Docs on aiojobs says "The Scheduler has implied limit for amount of concurrent jobs (100 by default). ... It prevents a program over-flooding by running a billion of jobs at the same time". And still, we can happily spawn "billion" (well, until we run out of resources) aiohttp handlers.

            So the question is, why is it implemented the way it is? Am I missing some important detail? I think we can somehow pause requests handlers using Semafor, but the socket is still accepted by aiohttp and coroutine is spawned, in contrast with nginx. Also when deploying behind nginx, the number of worker_connections and aiohttp desired limit will certainly be different.(because nginx may serve static files also)

            ...

            ANSWER

            Answered 2019-May-28 at 14:25

            Based on the developers' comments on the linked issue, the reasons for this choice are the following:

            • The application can return a 4xx or 5xx response if it detects that the number of connections is larger than what it can reasonably handle. (This differs from the Semaphore idiom, which would effectively queue the connection.)

            • Throttling the number of server connections is more complicated than just specifying a number, because the limit might well depend on what your coroutines are doing, i.e. it should at least be path-based. Andrew Svetlov links to NGINX documentation about connection limiting to support this.

            • It is anyway recommended to put aiohttp behind a specialized front server such as NGINX.

            More detail than this can only be provided by the developer(s), who have been known to read this tag.

            At this point, it appears that the recommended solution is to either use a reverse proxy for limiting, or an application-based limit like this decorator (untested):

            Source https://stackoverflow.com/questions/56320850

            QUESTION

            How to implement single-producer multi-consumer with aioredis pub/sub
            Asked 2019-Jan-14 at 19:32

            I have the web app. That app has endpoint to push some object data to redis channel.
            And another endpoint handles websocket connection, where that data is fetched from channel and send to client via ws.

            When i connect via ws, messages gets only first connected client.

            How to read messages from redis channel with multiple clients and not create a new subscription?

            Websocket handler.
            Here i subscribe to channel, save it to app (init_tram_channel). Then run job where i listen channel and send messages(run_tram_listening).

            ...

            ANSWER

            Answered 2019-Jan-14 at 00:29

            I guess a message is received from one Redis subscription only once, and if there is more than one listeners in your app, then only one of them will get it.

            So you need to create something like mini pub/sub inside the application to distribute the messages to all listeners (websocket connections in this case).

            Some time ago I've made an aiohttp websocket chat example - not with Redis, but at least the cross-websocket distribution is there: https://github.com/messa/aiohttp-nextjs-demo-chat/blob/master/chat_web/views/api.py

            The key is to have an application-wide message_subcriptions, where every websocket connection registers itself, or perhaps its own asyncio.Queue (I've used Event in my example, but that's suboptimal), and whenever message comes from Redis, it is pushed to all relevant queues.

            Of course when websocket connection ends (client unsubscribe, disconnect, failure...) the queue should be removed (and possibly Redis subscription cancelled if it was the last connection listening to it).

            Asyncio doesn’t mean we should forget about queues :) Also it’s good to get familiar with combining multiple tasks at once (reading from websocket, reading from message queue, perhaps reading from some notification queue...). Using queues can also help you to handle client reconnects more cleanly (without loss of any messages).

            Source https://stackoverflow.com/questions/54159292

            Community Discussions, Code Snippets contain sources that include Stack Exchange Network

            Vulnerabilities

            No vulnerabilities reported

            Install aiojobs

            You can install using 'pip install aiojobs' or download it from GitHub, PyPI.
            You can use aiojobs like any standard Python library. You will need to make sure that you have a development environment consisting of a Python distribution including header files, a compiler, pip, and git installed. Make sure that your pip, setuptools, and wheel are up to date. When using pip it is generally recommended to install packages in a virtual environment to avoid changes to the system.

            Support

            For any new features, suggestions and bugs create an issue on GitHub. If you have any questions check and ask questions on community page Stack Overflow .
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries
            Install
          • PyPI

            pip install aiojobs

          • CLONE
          • HTTPS

            https://github.com/aio-libs/aiojobs.git

          • CLI

            gh repo clone aio-libs/aiojobs

          • sshUrl

            git@github.com:aio-libs/aiojobs.git

          • Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link

            Consider Popular Reactive Programming Libraries

            axios

            by axios

            RxJava

            by ReactiveX

            async

            by caolan

            rxjs

            by ReactiveX

            fetch

            by github

            Try Top Libraries by aio-libs

            aiohttp

            by aio-libsPython

            aioredis-py

            by aio-libsPython

            aioredis

            by aio-libsPython

            aiomysql

            by aio-libsPython

            aiopg

            by aio-libsPython