Boost logo

Boost Users :

Subject: Re: [Boost-users] [asio] Custom asynchronous service
From: Marat Abrarov (abrarov_at_[hidden])
Date: 2012-10-04 06:02:05


Hi Acer,

> I would like to adapt my class to asio for offering
> async_do_something(param, callback) interfaces.

http://sourceforge.net/projects/asio-samples/

especially (SVN):

https://asio-samples.svn.sourceforge.net/svnroot/asio-samples/trunk/include/ma/tutorial/async_interface.hpp
https://asio-samples.svn.sourceforge.net/svnroot/asio-samples/trunk/include/ma/tutorial/async_implementation.hpp

or

https://asio-samples.svn.sourceforge.net/svnroot/asio-samples/trunk/include/ma/echo/server/session.hpp
https://asio-samples.svn.sourceforge.net/svnroot/asio-samples/trunk/include/ma/nmea/cyclic_read_session.hpp

> After reading examples presented in asio/examples/services/ and some asio
> source code.
>
> I found the example does not do invoke callback stuff (e.g.
> asio/examples/service/logger_service.cpp).
>
> In case of asio source code, there are classes such as
> detail::wait_handler<> that wrap user callbacks for invoked later.

It's not a wrapper for deferred invocation. Here's my implementation of handler parking (Asio custom memory allocation
and custom invocation strategy are supported):
https://asio-samples.svn.sourceforge.net/svnroot/asio-samples/trunk/include/ma/handler_storage.hpp

Regards,
Marat Abrarov.


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net