跳转到主要内容

基于回调的心跳处理器

项目描述

基于回调的心跳处理器

Version Downloads Status Coverage License

安装

sprockets.handlers.heartbeat 可在 Python包索引 上找到,并且可以通过 pipeasy_install 安装。

pip install sprockets.handlers.heartbeat

文档

https://sprocketshandlersheartbeat.readthedocs.org

需求

示例

此示例演示了如何通过注册每次对 /heartbeat 的请求都调用的 check_database 方法来使用 sprockets.handlers.heartbeat

from sprockets.handlers import heartbeat
from tornado import web


def check_database():
    """Any check method should return a bool specifying the check is ok.

    :rtype: bool

    """
    return True

# Register the check method
heartbeat.register_callback(check_database)

# Create a Tornado application
app = web.Application([('/heartbeat', heartbeat.HeartbeatHandler)])

版本历史

可在 https://sprocketshandlersheartbeat.readthedocs.org/en/latest/history.html 查找

项目详情


下载文件

下载适合您的平台文件。如果您不确定选择哪个,请了解有关 安装包 的更多信息。

源分发

sprockets.handlers.heartbeat-0.1.0.tar.gz (5.2 kB 查看哈希值)

上传时间 来源

由...