Files
boost_beast/doc/qbk/08_design.qbk
T
Vinnie Falco 3a28e999af Update for Net-TS Asio (API Change):
fix #769

The following classes are removed:

* handler_type
* async_result
* async_completion
* is_dynamic_buffer
* is_const_buffer_sequence
* is_mutable_buffer_sequence
* handler_alloc

Actions Required:

* Use BOOST_ASIO_HANDLER_TYPE instead of handler_type
* Use BOOST_ASIO_INITFN_RESULT_TYPE instead of async_result
* Use boost::asio::async_completion
* Use boost::asio::is_dynamic_buffer
* Use boost::asio::is_const_buffer_sequence
* Use boost::asio::is_mutable_buffer_sequence
* boost::asio::associated_allocator_t replaces handler_alloc
2017-10-23 17:11:27 -07:00

61 lines
2.3 KiB
Plaintext

[/
Copyright (c) 2016-2017 Vinnie Falco (vinnie dot falco at gmail dot com)
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
Official repository: https://github.com/boostorg/beast
]
[section Design Choices]
The implementations were originally driven by business needs of cryptocurrency
server applications (e.g. [@https://github.com/ripple/rippled rippled]),
written in C++. These needs were not met by existing solutions so Beast
was written from scratch as a solution. Beast's design philosophy avoids
flaws exhibited by other libraries:
* Don't try to do too much.
* Don't sacrifice performance.
* Mimic __Asio__; familiarity breeds confidence.
* Role-symmetric interfaces; client and server the same (or close to it).
* Leave important decisions, such as allocating memory or
managing flow control, to the user.
Beast uses the __DynamicBuffer__ concept presented in the Networking TS
(__N4588__), and relies heavily on the __ConstBufferSequence__ and
__MutableBufferSequence__ concepts for passing buffers to functions.
The authors have found the dynamic buffer and buffer sequence interfaces to
be optimal for interacting with Asio, and for other tasks such as incremental
parsing of data in buffers (for example, parsing websocket frames stored
in a [link beast.ref.boost__beast__static_buffer `static_buffer`]).
During the development of Beast the authors have studied other software
packages and in particular the comments left during the Boost Review process
of other packages offering similar functionality. In this section and the
FAQs that follow we attempt to answer those questions that are also applicable
to Beast.
For HTTP we model the message to maximize flexibility of implementation
strategies while allowing familiar verbs such as [*`read`] and [*`write`].
The HTTP interface is further driven by the needs of the WebSocket module,
as a WebSocket session requires a HTTP Upgrade handshake exchange at the
start. Other design goals:
* Keep it simple.
* Stay low level; don't invent a whole web server or client.
* Allow for customizations, if the user needs it.
[include 08_design/1_http_message.qbk]
[include 08_design/2_http_comparison.qbk]
[include 08_design/3_websocket_zaphoyd.qbk]
[include 08_design/4_faq.qbk]
[endsect]