diff --git a/.travis.yml b/.travis.yml index e13ce73..3aab5c3 100644 --- a/.travis.yml +++ b/.travis.yml @@ -23,4 +23,4 @@ deploy: tags: true all_branches: true password: - secure: [REPLACE-ME] \ No newline at end of file + secure: "iznyfbrIbZXOVWiGjroqExbpA9wFNgy3OEuyhT0r4nyYaLqAsbHxQFop6EqO7zt0laWiE1Cj0tpQSud6rf+Et1zN9j5Xcc0ftpZWuweVFM2zgULiZIWocG4MhwFPf+DuaGhunsrLcPhxA99Jzi/OxlOdgiGDYFviRAqy4V8GsH4=" \ No newline at end of file diff --git a/README.rst b/README.rst index be7fe5f..e850cd7 100644 --- a/README.rst +++ b/README.rst @@ -20,25 +20,33 @@ https://sprocketshandlersheartbeat.readthedocs.org Requirements ------------ -- `sprockets `_ +- `tornado `_ Example ------- -This examples demonstrates how to use ``sprockets.handlers.heartbeat`` by ... +This examples demonstrates how to use ``sprockets.handlers.heartbeat`` by +registering the ``check_database`` method that is invoked each time a request +to ``/heartbeat`` is made. .. code:: python + from sprockets.handlers import heartbeat from tornado import web - from sprockets.handlers import heartbeat def check_database(): - # Verify connectivity to our database - return is_database_up() # Return True/False + """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) - app = web.Application([(r'/heartbeat', heartbeat.HeartbeatHandler)]) + # Create a Tornado application + app = web.Application([('/heartbeat', heartbeat.HeartbeatHandler)]) Version History --------------- diff --git a/docs/examples.rst b/docs/examples.rst index dbddbe2..bdf11cf 100644 --- a/docs/examples.rst +++ b/docs/examples.rst @@ -1,10 +1,24 @@ Examples ======== -The following example ... +The following example demonstrates how to create a method that is invoked on +each call to ``/heartbeat`` in a web application. .. code:: python - from sprockets import handlers.heartbeat + from sprockets.handlers import heartbeat + from tornado import web - class Foo(object): - pass \ No newline at end of file + + 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)]) diff --git a/docs/history.rst b/docs/history.rst index 9c6846c..3245ca8 100644 --- a/docs/history.rst +++ b/docs/history.rst @@ -1,5 +1,4 @@ Version History --------------- -- 0.0.0 [YYYY-MM-DD] - - Change 1 - - Change 2 \ No newline at end of file +- 0.1.0 [2014-10-14] + - Initial release diff --git a/docs/index.rst b/docs/index.rst index 47b6e8b..152a9d4 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -16,8 +16,7 @@ and can be installed via ``pip`` or ``easy_install``: Requirements ------------ -@TODO: Put full requirements list here, should match requirements.txt -- `sprockets `_ +- `tornado `_ API Documentation ----------------- diff --git a/requirements.txt b/requirements.txt index 9724f0b..716f2ab 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1 +1 @@ -sprockets<2 \ No newline at end of file +tornado \ No newline at end of file diff --git a/setup.py b/setup.py index 0cfab53..e85317c 100644 --- a/setup.py +++ b/setup.py @@ -29,7 +29,7 @@ if sys.version_info < (3, 0): setuptools.setup( name='sprockets.handlers.heartbeat', - version='0.0.0', + version='0.1.0', description='A callback-based heartbeat handler', long_description=codecs.open('README.rst', encoding='utf-8').read(), url='https://github.com/sprockets/sprockets.handlers.heartbeat.git',