Re: [rados] Asynchronous operations

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, 27 Jun 2012, Rutger ter Borg wrote:
> 
> 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.

There is a get_return_value() method on the AioCompletion that gives you 
bytes read (for reads).  For write operations, it is always 0 (success) or 
an error code.

> b) is it possible to cancel outstanding asynchronous operations? I.e., have
> the possibility to implement something like
> 
> pool.cancel();

Not currently.  This is probably something we should add.

sage
--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [CEPH Users]     [Ceph Large]     [Information on CEPH]     [Linux BTRFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]
  Powered by Linux