Tornado 5.1 Documentation
Examples in the tornado documentation will generally use the native form. Translation between the two forms is generally straightforward: # Decorated: # Native: # Normal function declaration # with decorator special exception. # Return normally raise gen.Return(b) return b Other differences between the two forms of coroutine are: • Native coroutines are generally faster. • Native coroutines can use async Future object. Native coroutines return an awaitable object that is not a Future. In Tornado the two are mostly interchangeable. How it works This section explains the operation of decorated coroutines0 码力 | 243 页 | 895.80 KB | 1 年前3
Tornado 6.0 Documentation
Stack Overflow • Wiki 3 Tornado Documentation, Release 6.0.4 4 Chapter 1. Quick links CHAPTER TWO HELLO, WORLD Here is a simple “Hello, world” example web app for Tornado: import tornado.ioloop Examples in the Tornado documentation will generally use the native form. Translation between the two forms is generally straightforward: # Decorated: # Native: # Normal function declaration # with decorator special exception. # Return normally raise gen.Return(b) return b Other differences between the two forms of coroutine are outlined below. • Native coroutines: – are generally faster. – can use async0 码力 | 245 页 | 885.76 KB | 1 年前3
Tornado 5.1 Documentation
Examples in the tornado documentation will generally use the native form. Translation between the two forms is generally straightforward: # Decorated: # Native: # Normal function declaration # Return normally raise gen.Return(b) return b Other differences between the two forms of coroutine are: Native coroutines are generally faster. Native coroutines can use async for a Future object. Native coroutines return an awaitable object that is not a Future. In Tornado the two are mostly interchangeable. How it works This section explains the operation of decorated coroutines0 码力 | 359 页 | 347.32 KB | 1 年前3
Tornado 4.5 Documentation
version is more complex, but Futures are nonetheless recommended practice in Tornado because they have two major advantages. Error handling is more consistent since the Future.result method can simply raise calling self.set_status(404) and producing the response directly in prepare(). Redirection There are two main ways you can redirect requests in Tornado: RequestHandler.redirect and with the RedirectHandler also have the global function call _() available for string translation. The translate function has two forms: _("Translate this string") which translates the string directly based on the current locale0 码力 | 333 页 | 322.34 KB | 1 年前3
Tornado 6.1 Documentation
Examples in the Tornado documentation will generally use the native form. Translation between the two forms is generally straightforward: # Decorated: # Native: # Normal function declaration # with decorator special exception. # Return normally raise gen.Return(b) return b Other differences between the two forms of coroutine are outlined below. • Native coroutines: – are generally faster. – can use async a Future object. Native coroutines return an awaitable object that is not a Future. In Tornado the two are mostly interchangeable. How it works This section explains the operation of decorated coroutines0 码力 | 245 页 | 904.24 KB | 1 年前3
Tornado 4.5 Documentation
version is more complex, but Futures are nonetheless recommended practice in Tornado because they have two major advantages. Error handling is more consistent since the Future.result method can simply raise calling self.set_status(404) and producing the response directly in prepare(). Redirection There are two main ways you can redirect requests in Tornado: RequestHandler.redirect and with the RedirectHandler also have the global function call _() available for string translation. The translate function has two forms: _("Translate this string") which translates the string directly based on the current locale0 码力 | 222 页 | 833.04 KB | 1 年前3
Tornado 6.4 Documentation
Stack Overflow • Wiki 3 Tornado Documentation, Release 6.4 4 Chapter 1. Quick links CHAPTER TWO HELLO, WORLD Here is a simple “Hello, world” example web app for Tornado: import asyncio import Examples in the Tornado documentation will generally use the native form. Translation between the two forms is generally straightforward: # Decorated: # Native: # Normal function declaration # with decorator special exception. # Return normally raise gen.Return(b) return b Other differences between the two forms of coroutine are outlined below. • Native coroutines: – are generally faster. – can use async0 码力 | 268 页 | 1.09 MB | 1 年前3
Tornado 6.2 Documentation
Stack Overflow • Wiki 3 Tornado Documentation, Release 6.2 4 Chapter 1. Quick links CHAPTER TWO HELLO, WORLD Here is a simple “Hello, world” example web app for Tornado: import asyncio import Examples in the Tornado documentation will generally use the native form. Translation between the two forms is generally straightforward: # Decorated: # Native: # Normal function declaration # with decorator special exception. # Return normally raise gen.Return(b) return b Other differences between the two forms of coroutine are outlined below. • Native coroutines: – are generally faster. – can use async0 码力 | 260 页 | 1.06 MB | 1 年前3
Tornado 6.4 Documentation
Stack Overflow • Wiki 3 Tornado Documentation, Release 6.4 4 Chapter 1. Quick links CHAPTER TWO HELLO, WORLD Here is a simple “Hello, world” example web app for Tornado: import asyncio import Examples in the Tornado documentation will generally use the native form. Translation between the two forms is generally straightforward: # Decorated: # Native: # Normal function declaration # with decorator special exception. # Return normally raise gen.Return(b) return b Other differences between the two forms of coroutine are outlined below. • Native coroutines: – are generally faster. – can use async0 码力 | 268 页 | 1.09 MB | 1 年前3
Tornado 6.4 Documentation
Stack Overflow • Wiki 3 Tornado Documentation, Release 6.4 4 Chapter 1. Quick links CHAPTER TWO HELLO, WORLD Here is a simple “Hello, world” example web app for Tornado: import asyncio import Examples in the Tornado documentation will generally use the native form. Translation between the two forms is generally straightforward: # Decorated: # Native: # Normal function declaration # with decorator special exception. # Return normally raise gen.Return(b) return b Other differences between the two forms of coroutine are outlined below. • Native coroutines: – are generally faster. – can use async0 码力 | 268 页 | 1.09 MB | 1 年前3
共 20 条
- 1
- 2













