]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commit
librados: add async interfaces for use with Networking TS
authorCasey Bodley <cbodley@redhat.com>
Mon, 13 Feb 2017 19:55:06 +0000 (14:55 -0500)
committerCasey Bodley <cbodley@redhat.com>
Tue, 9 Jan 2018 14:58:18 +0000 (09:58 -0500)
commitf473d570138e8bbcaf8c80a2f9143dd695e0299c
treed221fb19a24472b4c69ff74413ecac1ff3cdc45a
parent0cdb6a74e7b126efe21d9a68832231ccc263e1f2
librados: add async interfaces for use with Networking TS

Defines asynchronous librados operations that satisfy all of the
"Requirements on asynchronous operations" imposed by the C++ Networking
TS [1] in section 13.2.7. These operations are implemented in terms of
boost::asio, but the interfaces themselves are free of boost types -
this makes the transition to std::net trivial when it's available.

These interfaces conform to the Extensible Asynchronous Model [2] that
originated in boost::asio. This model allows the last 'handler' argument
to either be a callback that gets the result, a coroutine yield_context
that will suspend until completion, or a 'use_future' tag to request the
result in a std::future (see the unit tests for examples of each). The
'Extensible' part also enables further integration with new frameworks.

For now, only async_read(), async_write(), and the read/write variants
of async_operate() are provided.

[1] Working Draft, C++ Extensions for Networking
http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/n4711.pdf
[2] "Library Foundations for Asynchronous Operations"
http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n3896.pdf

Signed-off-by: Casey Bodley <cbodley@redhat.com>
qa/workunits/rados/test.sh
src/librados/librados_asio.h [new file with mode: 0644]
src/test/librados/CMakeLists.txt
src/test/librados/asio.cc [new file with mode: 0644]