{ "info": { "author": "KJ", "author_email": "jdotpy@users.noreply.github.com", "bugtrack_url": null, "classifiers": [ "Programming Language :: Python :: 3" ], "description": "# dispatch\nPython package for timed dispatching of events or work\n\n# Usage\n\n\t### The Reactor ###\n\tfrom dispatch import Reactor\n\n\tr = Reactor()\n\t# The dispatch function needs two parameters, a schedule and an action\n\tschedule = r.schedule_interval(seconds=2) # Run every 2 seconds\n\taction = r.action(print, \"hello\") # Call the print function with the parameter \"hello\"\n\tr.dispatch(schedule, action)\n\tr.run()\n\t\n\n\t### The Actions ###\n\t# There are two helper functions that build actions based on functions:\n\t\n\tr.action(func, parameter, parameter2, kwarg1=value) # Runs in main loop\n\tr.background_action(func, parameter, parameter2, kwarg1=value) # Runs in new thread\n\n\t### The Schedules ###\n\t# A schedule is just an iterator that returns timestamps but there are \n\t# several constructors included which make needing to write one rare\n\n\tfrom datetime import datetime\n\n\t# Run once on April 1st 2012 at 4 am\n\tr.schedule_one_time(datetime(2020,4,1,4)) \n\n\t# Run on August 5th and 8th, 2020 \n\ttimestamps = [datetime(2020, 8, 1), datetime(2020, 8, 5)]\n\tschedule = iter(timestamps) \n\n\t# To run at 8am and 5pm on Tuesdays and thursdays\n\tr.schedule_calendar(days_of_week=[\"Tuesday\", \"Thursday\"], hours=[8, 17])\n\n\t# To run hourly on the 15th minute\n\tr.schedule_hourly(minute=15)\n\n\t# To run daily at 5:12 pm \n\tr.schedule_daily(hour=17, minute=12)\n\n\t# To run every hour and a half\n\tr.schedule_interval(hours=1, minutes=30)\n\n\t# To run every 26 hours till the year 2020 \n\tr.schedule_interval(days=1 hours=2, till=datetime(2020, 1, 1))\n\n\t# To run on the 1st 5th, 10th, 15th, 20th, and 25th of the month @ midnight\n\tr.schedule_calendar(days=[1,5,10,15,20,25])\n\n\t# To run mondays on every hour \n\tr.schedule_calendar(days_of_week=['Monday'], hours='*')", "description_content_type": "text/markdown", "docs_url": null, "download_url": "https://github.com/jdotpy/dispatch/tarball/master", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/jdotpy/dispatch", "keywords": "tools", "license": "", "maintainer": "", "maintainer_email": "", "name": "dispatch-reactor", "package_url": "https://pypi.org/project/dispatch-reactor/", "platform": "", "project_url": "https://pypi.org/project/dispatch-reactor/", "project_urls": { "Download": "https://github.com/jdotpy/dispatch/tarball/master", "Homepage": "https://github.com/jdotpy/dispatch" }, "release_url": "https://pypi.org/project/dispatch-reactor/2.1.0/", "requires_dist": null, "requires_python": "", "summary": "Module for dispatching jobs and timed operations", "version": "2.1.0" }, "last_serial": 5129217, "releases": { "1.0.0": [ { "comment_text": "", "digests": { "md5": "0594643a9767fcbdf72258e5fef16625", "sha256": "17de49bf9d8933f96290e22d2dbea7f9f61f694afd995768605ec0b14fc951e4" }, "downloads": -1, "filename": "dispatch_reactor-1.0.0.tar.gz", "has_sig": false, "md5_digest": "0594643a9767fcbdf72258e5fef16625", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5743, "upload_time": "2019-03-14T19:28:58", "url": "https://files.pythonhosted.org/packages/c2/75/1aa2e201a0c8130ff1497cd06c2be0729c10985137d268354cd32e269258/dispatch_reactor-1.0.0.tar.gz" } ], "2.0.0": [ { "comment_text": "", "digests": { "md5": "f78908368c036db9867128eb708b327c", "sha256": "58c752221f27e292ee2aa53f3201687a3a421ba3a87652be781a19ee2243827d" }, "downloads": -1, "filename": "dispatch_reactor-2.0.0.tar.gz", "has_sig": false, "md5_digest": "f78908368c036db9867128eb708b327c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6723, "upload_time": "2019-03-21T17:38:33", "url": "https://files.pythonhosted.org/packages/c5/4f/16960704cf4b6436ec2b8b8122382efef0a7e47c98244b3468881baf7207/dispatch_reactor-2.0.0.tar.gz" } ], "2.1.0": [ { "comment_text": "", "digests": { "md5": "1d862a7ca9da029155b3250083365c48", "sha256": "13035a7d2540f4d4bcd0ac36e9fff1f2e21f99ffc36551c6f8c39012bc38f260" }, "downloads": -1, "filename": "dispatch_reactor-2.1.0.tar.gz", "has_sig": false, "md5_digest": "1d862a7ca9da029155b3250083365c48", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6823, "upload_time": "2019-04-11T14:19:46", "url": "https://files.pythonhosted.org/packages/bf/d6/d0a49547713947069a9160a646cc58f2319ec35f3c531ff01c8b7b0c15db/dispatch_reactor-2.1.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "1d862a7ca9da029155b3250083365c48", "sha256": "13035a7d2540f4d4bcd0ac36e9fff1f2e21f99ffc36551c6f8c39012bc38f260" }, "downloads": -1, "filename": "dispatch_reactor-2.1.0.tar.gz", "has_sig": false, "md5_digest": "1d862a7ca9da029155b3250083365c48", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6823, "upload_time": "2019-04-11T14:19:46", "url": "https://files.pythonhosted.org/packages/bf/d6/d0a49547713947069a9160a646cc58f2319ec35f3c531ff01c8b7b0c15db/dispatch_reactor-2.1.0.tar.gz" } ] }