msgid ""
msgstr ""
"Project-Id-Version: Chinese (Simplified Han script) (Boost Beast Translation "
"(zh_Hans))\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2026-07-25 16:44+0000\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: Chinese (Simplified Han script) <https://"
"insights.cppalliance.org/weblate/projects/boost-beast-documentation-zh_Hans/"
"doc-qbk-03-core-7-composed-qbk/zh_Hans/>\n"
"Language: zh_Hans\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=1; plural=0;\n"
"X-Generator: Weblate 2026.5\n"

#. type: section title
#: 10
msgid "Writing Composed Operations"
msgstr "编写组合操作"

#. type: paragraph
#: 12
msgid ""
"Asynchronous operations are started by calling a free function or member "
"function known as an asynchronous ['__async_initfn__]. This function accepts "
"parameters specific to the operation as well as a __CompletionToken__. The "
"token is either a completion handler, or a type defining how the caller is "
"informed of the asynchronous operation result. Networking provides the "
"special tokens __use_future__ and __yield_context__ for using futures and "
"coroutines respectively. This system of customizing the return value and "
"method of completion notification is known as the ['Universal Asynchronous "
"Model] described in __N3747__, and a built in to __NetTS__. Here is an "
"example of an initiating function which reads a line from the stream and "
"echoes it back. This function is developed further in the next section:"
msgstr ""
"异步操作通过调用一个自由函数或成员函数来启动，该函数被称为异步[发起函数]。发"
"起函数接收操作相关的参数以及一个 __CompletionToken__ 完成令牌。该令牌可以是一"
"个完成处理器，也可以是一种用于定义调用方如何获知异步操作结果的方式。网络库提"
"供 __use_future__ 和 __yield_context__ 这两种特殊令牌，分别用于支持 future 和"
"协程。这种自定义返回值及完成通知方式的机制被称为 __N3747__ 中描述的通用异步模"
"型，并已内置到 __NetTS__ 中。以下是一个发起函数的示例，该函数用于从流中读取一"
"行数据并将其回显回去。下一节将进一步开发此函数："

#. type: paragraph
#: 28
msgid ""
"This initiating function receives the dynamic buffer by lvalue-reference,"
msgstr "该发起函数通过左值引用接收动态缓冲区，"

#. type: paragraph
#: 33
msgid ""
"Authors using Beast can reuse the library's primitives to create their own "
"initiating functions for performing a series of other, intermediate "
"asynchronous operations before invoking a final completion handler. The set "
"of intermediate actions produced by an initiating function is known as a "
"[@http://blog.think-async.com/2009/08/composed-operations-coroutines-and-"
"code.html ['composed operation]]. To ensure full interoperability and well-"
"defined behavior, __Asio__ imposes requirements on the implementation of "
"composed operations. These classes and functions make it easier to develop "
"initiating functions and their composed operations:"
msgstr ""
"使用 Beast 的开发者可以复用库中的基本组件，来创建自己的发起函数。这些发起函数"
"会在执行一系列中间异步操作之后，最终调用一个完成处理器。发起函数所产生的这一"
"系列中间动作，被称为 [组合操作]。为确保良好的互操作性和行为的一致性"
"，__Asio__ 对组合操作的实现方式提出了一些要求。以下提供的类和函数，可以帮助开"
"发者更轻松地编写发起函数及其对应的组合操作："

#. type: table title
#: 44
msgid "Asynchronous Helpers"
msgstr "异步辅助函数"

#. type: table cell
#: 44
msgid "Name"
msgstr "名称"

#. type: table cell
#: 44
msgid "Description"
msgstr "描述"

#. type: table cell
#: 44
msgid ""
"[link beast.ref.boost__beast__async_base `async_base`] [link "
"beast.ref.boost__beast__stable_async_base `stable_async_base`]"
msgstr ""
"[link beast.ref.boost__beast__async_base `async_base`] [link "
"beast.ref.boost__beast__stable_async_base `stable_async_base`]"

#. type: table cell
#: 44
msgid ""
"This class is designed to be used as a base class when authoring composed "
"asynchronous operations expressed as an intermediate completion handler. "
"This eliminates the need for the extensive boilerplate to propagate the "
"associated executor and the associated allocator."
msgstr ""
"该类作为基类，专门用于编写以中间完成处理器形式表达的组合异步操作。使用它，可"
"以避免编写大量用于传递关联执行器和关联分配器的样板代码。"

#. type: table cell
#: 44
msgid "[link beast.ref.boost__beast__allocate_stable `allocate_stable`]"
msgstr "[link beast.ref.boost__beast__allocate_stable `allocate_stable`]"

#. type: table cell
#: 44
msgid ""
"For composed operation algorithms which need stable storage for temporary "
"objects, this function may be used. Memory for the stable storage is "
"allocated using the allocator associated with the final completion handler. "
"The implementation automatically destroys the temporary object before the "
"final completion handler is invoked, or when the intermediate completion "
"handler is destroyed."
msgstr ""
"对于需要为临时对象提供稳定存储的组合操作算法，可以使用此函数。该函数通过最终"
"完成处理器所关联的分配器来分配稳定存储所需的内存。它会在最终完成处理器被调用"
"之前，或者中间完成处理器被销毁时，自动销毁这些临时对象。"

#. type: table cell
#: 44
msgid "[link beast.ref.boost__beast__bind_handler `bind_handler`]"
msgstr "[link beast.ref.boost__beast__bind_handler `bind_handler`]"

#. type: table cell
#: 44
msgid ""
"This function creates a new handler which, when invoked, calls the original "
"handler with the list of bound arguments. Any parameters passed in the "
"invocation will be substituted for placeholders present in the list of bound "
"arguments. Parameters which are not matched to placeholders are silently "
"discarded.\n"
"\n"
"The passed handler and arguments are forwarded into the returned handler, "
"whose associated allocator and associated executor will be the same as those "
"of the original handler."
msgstr ""
"该函数用于创建一个新的处理器。当这个新处理器被调用时，它会使用预先绑定的参数"
"列表去调用原始的处理器。调用时传入的参数，会替换掉绑定列表中的占位符；而那些"
"没有对应占位符的参数，则会被悄悄丢弃。\n"
"\n"
"传入的处理器和参数，都会被转发给返回的新处理器。这个新处理器的关联分配器和关"
"联执行器，与原始处理器完全相同。"

#. type: table cell
#: 44
msgid "[link beast.ref.boost__beast__bind_front_handler `bind_front_handler`]"
msgstr "[link beast.ref.boost__beast__bind_front_handler `bind_front_handler`]"

#. type: table cell
#: 44
msgid ""
"This function creates a new handler which, when invoked, calls the original "
"handler with the list of bound arguments, along with the list of invoked "
"arguments at either the front or the back of the argument list. Placeholders "
"are not supported.\n"
"\n"
"The passed handler and arguments are forwarded into the returned handler, "
"whose associated allocator and associated executor will will be the same as "
"those of the original handler."
msgstr ""
"该函数用于创建新处理器。调用该新处理器时，系统会对原始处理器进行调用，并同时"
"传入绑定参数列表以及调用参数列表。调用参数列表可位于参数列表的前端或后端。该"
"函数不支持占位符。\n"
"\n"
"传入的处理器与参数被转发至返回的新处理器。该新处理器的关联分配器及关联执行器"
"均与原始处理器保持一致。"

#. type: table cell
#: 44
msgid "[link beast.ref.boost__beast__saved_handler `saved_handler`]"
msgstr "[link beast.ref.boost__beast__saved_handler `saved_handler`]"

#. type: table cell
#: 44
msgid ""
"This wrapper safely stores a completion handler so it may be invoked later, "
"allowing an implementation to \"pause\" an operation until some condition is "
"met."
msgstr ""
"该包装类用于安全存储完成处理器，以便后续调用。通过该机制，实现方可以对操作进"
"行“暂停”，直到满足特定条件后再继续执行。"
