This is a pre-production deployment of Warehouse, however changes made here WILL affect the production instance of PyPI.
Latest Version Dependencies status unknown Test status unknown Test coverage unknown
Project Description
Ramjet
======

|versions| |PyPI version| |versions| |Commitizen friendly|

わが征くは星の大海 —— Yang Wen-li

+------------------+
| |image4| |
+==================+
| 后台脚本的引擎 |
+------------------+

Links
-----

- `Documents <http: laisky.github.io="" ramjet=""/>`__
- `Github <https: github.com="" laisky="" ramjet="">`__
- `PyPI <https: pypi.python.org="" pypi="" ramjet="">`__

Install & Run
-------------

Need Python3.5.x.

.. code:: sh

# Install from pypi

$ pip install ramjet

.. code:: sh

# Install from source

$ python setup.py install
$ python -m ramjet [--debug=true]

Description
-----------

基于 asyncio 和 consurrent.futures 运行脚本(\ ``tasks``\ )。

每一个 task 都需要实现接口 ``bind_task()``\ 。

利用 ``ioloop``\ 、\ ``thread_executor``\ 、\ ``process_executor``
自行实现运行逻辑。

Demo
----

异步
~~~~

.. code:: py

from ramjet.engines import process_executor, thread_executor, ioloop


def bind_task():
# 将任务添加进事件循环中
ioloop.add_future(async_task(), callback)


@tornado.gen.coroutine
def async_task():
yield tornado.gen.sleep(3)
yield async_child_task()


@tornado.gen.coroutine
def async_child_task():
yield tornado.gen.sleep(1)
print('child task ok!')


def callback(future):
print('ok')

多线程 & 多进程
~~~~~~~~~~~~~~~

需要注意子进程没法回收,所以请确保 task 可以很好的结束。

.. code:: py

from ramjet.engines import process_executor, thread_executor, ioloop


def bind_task():
# 多线程
thread_executor.submit(task, your_arguments)
# 多进程
process_executor.submit(task, your_arguments)


def task(*args, **kw):
pass

定时任务
~~~~~~~~

::

from ramjet.engines import process_executor, thread_executor, ioloop


def bind_task():
now = ioloop.time()
run_at = now + 3600
ioloop.call_at(run_at, task, your_auguments)


def task(*args, **kw):
# 可以在 task 内设置下一次执行的时间
# ioloop.run_at(run_at, task, *args, **kw)

Versions
--------

`更新日志 <https: github.com="" laisky="" ramjet="" blob="" master="" changelog.md="">`__

.. |versions| image:: https://img.shields.io/badge/version-v1.2.1-blue.svg
:target:
.. |PyPI version| image:: https://badge.fury.io/py/ramjet.svg
:target: https://badge.fury.io/py/ramjet
.. |versions| image:: https://img.shields.io/badge/license-MIT/Apache-blue.svg
:target:
.. |Commitizen friendly| image:: https://img.shields.io/badge/commitizen-friendly-brightgreen.svg
:target: http://commitizen.github.io/cz-cli/
.. |image4| image:: http://7xjvpy.dl1.z0.glb.clouddn.com/ramjet.jpg
Release History

Release History

1.4

This version

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

1.2.2

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

1.2.1

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

1.1.1

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

1.1

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

Download Files

Download Files

TODO: Brief introduction on what you do with files - including link to relevant help section.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
ramjet-1.4.tar.gz (4.0 kB) Copy SHA256 Checksum SHA256 Source Oct 11, 2016

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS HPE HPE Development Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting