3 <meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
4 <title>io_service::strand::dispatch</title>
5 <link rel="stylesheet" href="../../../../../doc/src/boostbook.css" type="text/css">
6 <meta name="generator" content="DocBook XSL Stylesheets V1.78.1">
7 <link rel="home" href="../../../boost_asio.html" title="Boost.Asio">
8 <link rel="up" href="../io_service__strand.html" title="io_service::strand">
9 <link rel="prev" href="../io_service__strand.html" title="io_service::strand">
10 <link rel="next" href="get_io_service.html" title="io_service::strand::get_io_service">
12 <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
13 <table cellpadding="2" width="100%"><tr>
14 <td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../boost.png"></td>
15 <td align="center"><a href="../../../../../index.html">Home</a></td>
16 <td align="center"><a href="../../../../../libs/libraries.htm">Libraries</a></td>
17 <td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
18 <td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
19 <td align="center"><a href="../../../../../more/index.htm">More</a></td>
22 <div class="spirit-nav">
23 <a accesskey="p" href="../io_service__strand.html"><img src="../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../io_service__strand.html"><img src="../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../../boost_asio.html"><img src="../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="get_io_service.html"><img src="../../../../../doc/src/images/next.png" alt="Next"></a>
26 <div class="titlepage"><div><div><h4 class="title">
27 <a name="boost_asio.reference.io_service__strand.dispatch"></a><a class="link" href="dispatch.html" title="io_service::strand::dispatch">io_service::strand::dispatch</a>
28 </h4></div></div></div>
30 <a class="indexterm" name="idp172444928"></a>
31 Request the strand to invoke the given handler.
33 <pre class="programlisting"><span class="keyword">template</span><span class="special"><</span>
34 <span class="keyword">typename</span> <a class="link" href="../CompletionHandler.html" title="Completion handler requirements">CompletionHandler</a><span class="special">></span>
35 <a class="link" href="../asynchronous_operations.html#boost_asio.reference.asynchronous_operations.return_type_of_an_initiating_function"><span class="emphasis"><em>void-or-deduced</em></span></a> <span class="identifier">dispatch</span><span class="special">(</span>
36 <span class="identifier">CompletionHandler</span> <span class="identifier">handler</span><span class="special">);</span>
39 This function is used to ask the strand to execute the given handler.
42 The strand object guarantees that handlers posted or dispatched through
43 the strand will not be executed concurrently. The handler may be executed
44 inside this function if the guarantee can be met. If this function is called
45 from within a handler that was posted or dispatched through the same strand,
46 then the new handler will be executed immediately.
49 The strand's guarantee is in addition to the guarantee provided by the
50 underlying <a class="link" href="../io_service.html" title="io_service"><code class="computeroutput"><span class="identifier">io_service</span></code></a>. The <a class="link" href="../io_service.html" title="io_service"><code class="computeroutput"><span class="identifier">io_service</span></code></a> guarantees that the
51 handler will only be called in a thread in which the io_service's run member
52 function is currently being invoked.
55 <a name="boost_asio.reference.io_service__strand.dispatch.h0"></a>
56 <span class="phrase"><a name="boost_asio.reference.io_service__strand.dispatch.parameters"></a></span><a class="link" href="dispatch.html#boost_asio.reference.io_service__strand.dispatch.parameters">Parameters</a>
58 <div class="variablelist">
59 <p class="title"><b></b></p>
60 <dl class="variablelist">
61 <dt><span class="term">handler</span></dt>
64 The handler to be called. The strand will make a copy of the handler
65 object as required. The function signature of the handler must be:
67 <pre class="programlisting"><span class="keyword">void</span> <span class="identifier">handler</span><span class="special">();</span>
75 <table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
76 <td align="left"></td>
77 <td align="right"><div class="copyright-footer">Copyright © 2003-2014 Christopher M. Kohlhoff<p>
78 Distributed under the Boost Software License, Version 1.0. (See accompanying
79 file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
84 <div class="spirit-nav">
85 <a accesskey="p" href="../io_service__strand.html"><img src="../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../io_service__strand.html"><img src="../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../../boost_asio.html"><img src="../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="get_io_service.html"><img src="../../../../../doc/src/images/next.png" alt="Next"></a>