Skip to main content

A wrapper around the tornado web server.

Changlog

0.12.0 - 14 April 2021
  • Add a new make_application hook to the Server for changing the WSGI app

  • Made it easier to alter what gets logged

0.11.0 - 26 March 2021
  • Added server_end_future to the Server object

  • Added announce_start and make_http_server hooks to Server

  • The http server and routes we make is now put onto the server object in serve

  • The default error catcher will return a “RequestCancelled” error if the request raises asyncio.CancelledError

0.10.1 - 8 January 2021
  • Removed the wait_for_futures helper. It’s not a great implementation.

  • The server now uses await self.wait_for_end() to wait till we should shut down the server. By default this does await self.final_future like it already was doing.

0.10.0 - 25 October 2020
  • Removed whirlwind.test_helpers

    • It was random and didn’t work well in an async context

    • Used asynctest which has warnings past python3.7 and isn’t necessary anymore

0.9.0 - 10 May 2020
  • The SimpleWebSocketBase and WSHandler handlers now take in a final_future which is used to stop the websocket stream when it is cancelled.

  • Websocket streams that take in child messages will now use the request future on the websocket to know when to stop.

0.8.0 - 12 March 2020
  • The status of a response when there is an exception will now look at:

    • If the msg is a dictionary, it’ll get “status” from that dictionary if it has that

    • If the exception has a “status” property, the status will be that value

    • Otherwise the status will be 500

0.7.2 - 6 March 2020
  • Fix a small mistake that meant http handlers weren’t logging even if log_exceptions=False wasn’t specified.

0.7.1 - 6 March 2020
  • Made it possible to accept files into a commander command. You can do this by sending a multipart/form-data to the endpoint. The body of the command will be extracted from a __body__ file you provide.

  • HTTP and WebSocket handlers can now be told not to log exceptions by giving them a class level log_exceptions = False attribute.

0.7 - 3 February 2020
  • Made transform_progress responsible for name spacing the progress messages

  • Store commands can now be interactive. If you define the execute method as taking in messages, then you can process extra messages sent to that command. You then define what messages it accepts by using the store.command decorator with the parent option as the interactive command.

  • Reusing a command with a different path is now an error

0.6 - 18 September 2019
0.5.3 - Dec 26 2018
  • WSHandler now has a connection_future that is cancelled if we lose the connection

0.5.2 - Oct 25 2018
  • Added a message_done hook to SimpleWebSocketBase

  • Fixed the test helpers so that you aren’t left with no set asyncio loop

0.5.1 - Oct 24 2018
  • Made the __server_time__ message for SimpleWebSocketBase optional.

  • Made sure to actually use the reprer set on request handlers

  • ProgressMessageMaker doesn’t nest dictionaries it receives

  • Added a transform_progress hook to SimpleWebSocketBase

0.5 - Oct 22 2018
  • Initial Release

Installation

This package is released to pypi under the name whirlwind-web. When you add this package to your setup.py it is recommended you either specify [peer] as well or pin input_algorithms, option_merge and tornado to particular versions. See https://github.com/delfick/whirlwind/blob/main/setup.py#L24-L28 for the recommended versions.

For example:

from setuptools import setup, find_packages

setup(
      name = "test"
    , version = "0.1"
    , include_package_data = True

    , install_requires =
      [ "whirlwind-web[peer]"
      , "whirlwind-web==0.5.2"
      ]
    )

Running the tests

To run the tests, create and activate a virtualenv somewhere and then:

$ pip install -e ".[peer,tests]"
$ pip install -e .

followed by ./test.sh

Alternatively:

$ pip install tox
$ tox

Usage

See https://whirlwind.readthedocs.io/en/latest/ for usage documentation.

Metadata

Release files for whirlwind-web 0.12.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for whirlwind-web 0.12.0
File Size Uploaded
whirlwind-web-0.12.0.tar.gz 17.6 kB Details

Release files / whirlwind-web-0.12.0.tar.gz

Download URL whirlwind-web-0.12.0.tar.gz
Size 17.6 kB
Tags Source
SHA-256 checksum
How to use checksums
f314d5b13bebb3dfd46f05dad7b7a57cac745e322377afc6953bbd76e3420d28
BLAKE2b-256 checksum
How to use checksums
cbf21d7a72bd8cafe6fb98e07a1c08e54101ecf44d4d4e6474c9bae0359ecfd2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.1 importlib_metadata/3.10.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.8.9

Release history Release notifications | RSS feed

This release

0.12.0 This release

1 release file

0.11.0

1 release file

0.10.1

1 release file

0.10.0

1 release file

0.9.0

1 release file

0.8.0

1 release file

0.7.2

1 release file

0.7.1

1 release file

0.7

1 release file

0.6

1 release file

0.5.3

1 release file

0.5.2

1 release file

0.5.1

1 release file

0.5

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page