The
concurrent.futures.ThreadPoolExecutor
class provides us:A high-level interface for synchronously executing callables.
A high-level interface for asynchronously executing callables.
A high-level interface for composing HTTP requests.
The
@tornado.concurrent.run_on_executor
decorator allows us to:Run an asynchronous method synchronously on an executor.
Run an asynchronous method on an executor without generating a Future.
Run a synchronous method asynchronously on an executor.
The recommended way to write asynchronous code in Tornado is to use:
Coroutines.
Chained callbacks.
Subroutines.
The
tornado.Testing.AsyncHTTPTestCase
class represents:A test case that starts up a Flask HTTP Server.
A test case that starts up a Tornado HTTP Server.
A test case that doesn't start up any HTTP Server.
If we want to convert the bytes in a JSON response body to a Python dictionary, we can use the following function:
tornado.escape.json_decode
tornado.escape.byte_decode
tornado.escape...
Argentina
Australia
Austria
Belgium
Brazil
Bulgaria
Canada
Chile
Colombia
Cyprus
Czechia
Denmark
Ecuador
Egypt
Estonia
Finland
France
Germany
Great Britain
Greece
Hungary
India
Indonesia
Ireland
Italy
Japan
Latvia
Lithuania
Luxembourg
Malaysia
Malta
Mexico
Netherlands
New Zealand
Norway
Philippines
Poland
Portugal
Romania
Russia
Singapore
Slovakia
Slovenia
South Africa
South Korea
Spain
Sweden
Switzerland
Taiwan
Thailand
Turkey
Ukraine
United States