From: Rutger ter Borg <rutger@terborg.net>
To: ceph-devel@vger.kernel.org
Subject: [rados] Asynchronous operations
Date: Wed, 27 Jun 2012 09:32:03 +0200 [thread overview]
Message-ID: <jsecti$m2u$1@dough.gmane.org> (raw)
Dear list,
I'm currently writing a Boost.Asio-like interface to librados.hpp. Most
things are working like expected, and some things I couldn't figure out
from the available docs and code. I have itemized a couple of questions
below.
* to avoid allocations done by rados, I'm currently using
buffer::create_static() for both reads and writes. I suppose this is ok?
* suppose you have the following code example
boost::asio::io_service ios;
pool pool( "some pool", ios );
std::string some_data( "this is an example string of data" );
pool.async_write_object_at( "hello", 0, boost::asio::buffer( some_data
), &done );
ios.run();
with respect to this interface, I have the following questions:
a) the IoCtx's synchronous read() and write() functions return the
number of bytes read and written; is there a way to get to this number
from AioCompletion? I would like to define the function signature for
the callback handler (see 'done' in the example above) something like
void( const boost::system::error_code&, std::size_t )
where the second argument would be the number of bytes transferred.
b) is it possible to cancel outstanding asynchronous operations? I.e.,
have the possibility to implement something like
pool.cancel();
?
TIA,
Regards,
Rutger
next reply other threads:[~2012-06-27 7:32 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-06-27 7:32 Rutger ter Borg [this message]
2012-06-27 15:22 ` [rados] Asynchronous operations Sage Weil
2012-07-23 15:59 ` Rutger ter Borg
2012-07-23 16:07 ` Josh Durgin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='jsecti$m2u$1@dough.gmane.org' \
--to=rutger@terborg.net \
--cc=ceph-devel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.