<trclass="memdesc:gaefab965b5645798d47f9244f2b3fe3fb"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Creates an asynchronous subscription. <br/></td></tr>
<trclass="memdesc:gacb2c83b58b7909715424cbc327fdd404"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Creates an asynchronous subscription with a timeout. <br/></td></tr>
<trclass="memdesc:ga17574d5165f7e285462e3d3b2709edf4"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Creates a synchronous subcription. <br/></td></tr>
<trclass="memdesc:ga96fa115fd5b2ef7658884da80714b91c"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Creates an asynchronous queue subscriber with a timeout. <br/></td></tr>
<p>Expresses interest in the given subject. The subject can have wildcards (see <aclass="el"href="group__wildcards_group.html">Wildcards</a>). Messages will be delivered to the associated <aclass="el"href="group__callbacks_group.html#gad1a5ac566893e13dc8c81ac0e9c87afe"title="Callback used to deliver messages to the application.">natsMsgHandler</a>.</p>
<dlclass="params"><dt>Parameters</dt><dd>
<tableclass="params">
<tr><tdclass="paramname">sub</td><td>the location where to store the pointer to the newly created <aclass="el"href="group__types_group.html#ga87158ec63b4f90f69e20451624ea01d8"title="Interest on a given subject.">natsSubscription</a> object. </td></tr>
<tr><tdclass="paramname">nc</td><td>the pointer to the <aclass="el"href="group__types_group.html#gaf88dca0a18efb5c5e994d265a9f04aec"title="A connection to a NATS Server.">natsConnection</a> object. </td></tr>
<tr><tdclass="paramname">subject</td><td>the subject this subscription is created for. </td></tr>
<tr><tdclass="paramname">cb</td><td>the <aclass="el"href="group__callbacks_group.html#gad1a5ac566893e13dc8c81ac0e9c87afe"title="Callback used to deliver messages to the application.">natsMsgHandler</a> callback. </td></tr>
<tr><tdclass="paramname">cbClosure</td><td>a pointer to an user defined object (can be <code>NULL</code>). See the <aclass="el"href="group__callbacks_group.html#gad1a5ac566893e13dc8c81ac0e9c87afe"title="Callback used to deliver messages to the application.">natsMsgHandler</a> prototype. </td></tr>
<p>Expresses interest in the given subject. The subject can have wildcards (see <aclass="el"href="group__wildcards_group.html">Wildcards</a>). Messages will be delivered to the associated <aclass="el"href="group__callbacks_group.html#gad1a5ac566893e13dc8c81ac0e9c87afe"title="Callback used to deliver messages to the application.">natsMsgHandler</a>.</p>
<p>If no message is received by the given timeout (in milliseconds), the message handler is invoked with a <code>NULL</code> message.<br/>
You can then destroy the subscription in the callback, or simply return, in which case, the message handler will fire again when a message is received or the subscription times-out again.</p>
<dlclass="section note"><dt>Note</dt><dd>Receiving a message reset the timeout. Until all pending messages are processed, no timeout will occur. The timeout starts when the message handler for the last pending message returns.</dd></dl>
<dlclass="section warning"><dt>Warning</dt><dd>If you re-use message handler code between subscriptions with and without timeouts, keep in mind that the message passed in the message handler may be <code>NULL</code>.</dd></dl>
<dlclass="params"><dt>Parameters</dt><dd>
<tableclass="params">
<tr><tdclass="paramname">sub</td><td>the location where to store the pointer to the newly created <aclass="el"href="group__types_group.html#ga87158ec63b4f90f69e20451624ea01d8"title="Interest on a given subject.">natsSubscription</a> object. </td></tr>
<tr><tdclass="paramname">nc</td><td>the pointer to the <aclass="el"href="group__types_group.html#gaf88dca0a18efb5c5e994d265a9f04aec"title="A connection to a NATS Server.">natsConnection</a> object. </td></tr>
<tr><tdclass="paramname">subject</td><td>the subject this subscription is created for. </td></tr>
<tr><tdclass="paramname">timeout</td><td>the interval (in milliseconds) after which, if no message is received, the message handler is invoked with a <code>NULL</code> message. </td></tr>
<tr><tdclass="paramname">cb</td><td>the <aclass="el"href="group__callbacks_group.html#gad1a5ac566893e13dc8c81ac0e9c87afe"title="Callback used to deliver messages to the application.">natsMsgHandler</a> callback. </td></tr>
<tr><tdclass="paramname">cbClosure</td><td>a pointer to an user defined object (can be <code>NULL</code>). See the <aclass="el"href="group__callbacks_group.html#gad1a5ac566893e13dc8c81ac0e9c87afe"title="Callback used to deliver messages to the application.">natsMsgHandler</a> prototype. </td></tr>
<p>Similar to <aclass="el"href="group__conn_sub_group.html#gaefab965b5645798d47f9244f2b3fe3fb"title="Creates an asynchronous subscription.">natsConnection_Subscribe</a>, but creates a synchronous subscription that can be polled via <aclass="el"href="group__sub_group.html#ga6538a5d78dfb0f16514b94c8e74c11af"title="Returns the next available message.">natsSubscription_NextMsg()</a>.</p>
<dlclass="params"><dt>Parameters</dt><dd>
<tableclass="params">
<tr><tdclass="paramname">sub</td><td>the location where to store the pointer to the newly created <aclass="el"href="group__types_group.html#ga87158ec63b4f90f69e20451624ea01d8"title="Interest on a given subject.">natsSubscription</a> object. </td></tr>
<tr><tdclass="paramname">nc</td><td>the pointer to the <aclass="el"href="group__types_group.html#gaf88dca0a18efb5c5e994d265a9f04aec"title="A connection to a NATS Server.">natsConnection</a> object. </td></tr>
<tr><tdclass="paramname">subject</td><td>the subject this subscription is created for. </td></tr>
<p>Creates an asynchronous queue subscriber on the given subject. All subscribers with the same queue name will form the queue group and only one member of the group will be selected to receive any given message asynchronously.</p>
<dlclass="params"><dt>Parameters</dt><dd>
<tableclass="params">
<tr><tdclass="paramname">sub</td><td>the location where to store the pointer to the newly created <aclass="el"href="group__types_group.html#ga87158ec63b4f90f69e20451624ea01d8"title="Interest on a given subject.">natsSubscription</a> object. </td></tr>
<tr><tdclass="paramname">nc</td><td>the pointer to the <aclass="el"href="group__types_group.html#gaf88dca0a18efb5c5e994d265a9f04aec"title="A connection to a NATS Server.">natsConnection</a> object. </td></tr>
<tr><tdclass="paramname">subject</td><td>the subject this subscription is created for. </td></tr>
<tr><tdclass="paramname">queueGroup</td><td>the name of the group. </td></tr>
<tr><tdclass="paramname">cb</td><td>the <aclass="el"href="group__callbacks_group.html#gad1a5ac566893e13dc8c81ac0e9c87afe"title="Callback used to deliver messages to the application.">natsMsgHandler</a> callback. </td></tr>
<tr><tdclass="paramname">cbClosure</td><td>a pointer to an user defined object (can be <code>NULL</code>). See the <aclass="el"href="group__callbacks_group.html#gad1a5ac566893e13dc8c81ac0e9c87afe"title="Callback used to deliver messages to the application.">natsMsgHandler</a> prototype. </td></tr>
<p>Creates an asynchronous queue subscriber on the given subject. All subscribers with the same queue name will form the queue group and only one member of the group will be selected to receive any given message asynchronously.</p>
<p>If no message is received by the given timeout (in milliseconds), the message handler is invoked with a <code>NULL</code> message.<br/>
You can then destroy the subscription in the callback, or simply return, in which case, the message handler will fire again when a message is received or the subscription times-out again.</p>
<dlclass="section note"><dt>Note</dt><dd>Receiving a message reset the timeout. Until all pending messages are processed, no timeout will occur. The timeout starts when the message handler for the last pending message returns.</dd></dl>
<dlclass="section warning"><dt>Warning</dt><dd>If you re-use message handler code between subscriptions with and without timeouts, keep in mind that the message passed in the message handler may be <code>NULL</code>.</dd></dl>
<dlclass="params"><dt>Parameters</dt><dd>
<tableclass="params">
<tr><tdclass="paramname">sub</td><td>the location where to store the pointer to the newly created <aclass="el"href="group__types_group.html#ga87158ec63b4f90f69e20451624ea01d8"title="Interest on a given subject.">natsSubscription</a> object. </td></tr>
<tr><tdclass="paramname">nc</td><td>the pointer to the <aclass="el"href="group__types_group.html#gaf88dca0a18efb5c5e994d265a9f04aec"title="A connection to a NATS Server.">natsConnection</a> object. </td></tr>
<tr><tdclass="paramname">subject</td><td>the subject this subscription is created for. </td></tr>
<tr><tdclass="paramname">queueGroup</td><td>the name of the group. </td></tr>
<tr><tdclass="paramname">timeout</td><td>the interval (in milliseconds) after which, if no message is received, the message handler is invoked with a <code>NULL</code> message. </td></tr>
<tr><tdclass="paramname">cb</td><td>the <aclass="el"href="group__callbacks_group.html#gad1a5ac566893e13dc8c81ac0e9c87afe"title="Callback used to deliver messages to the application.">natsMsgHandler</a> callback. </td></tr>
<tr><tdclass="paramname">cbClosure</td><td>a pointer to an user defined object (can be <code>NULL</code>). See the <aclass="el"href="group__callbacks_group.html#gad1a5ac566893e13dc8c81ac0e9c87afe"title="Callback used to deliver messages to the application.">natsMsgHandler</a> prototype. </td></tr>
<p>Similar to <aclass="el"href="group__conn_sub_group.html#ga3c9fee2775130786ef62f1cbeb191a48"title="Creates an asynchronous queue subscriber.">natsConnection_QueueSubscribe</a>, but creates a synchronous subscription that can be polled via <aclass="el"href="group__sub_group.html#ga6538a5d78dfb0f16514b94c8e74c11af"title="Returns the next available message.">natsSubscription_NextMsg()</a>.</p>
<dlclass="params"><dt>Parameters</dt><dd>
<tableclass="params">
<tr><tdclass="paramname">sub</td><td>the location where to store the pointer to the newly created <aclass="el"href="group__types_group.html#ga87158ec63b4f90f69e20451624ea01d8"title="Interest on a given subject.">natsSubscription</a> object. </td></tr>
<tr><tdclass="paramname">nc</td><td>the pointer to the <aclass="el"href="group__types_group.html#gaf88dca0a18efb5c5e994d265a9f04aec"title="A connection to a NATS Server.">natsConnection</a> object. </td></tr>
<tr><tdclass="paramname">subject</td><td>the subject this subscription is created for. </td></tr>
<tr><tdclass="paramname">queueGroup</td><td>the name of the group. </td></tr>
</table>
</dd>
</dl>
</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- HTML footer for doxygen 1.8.10-->
<!-- start footer part -->
<divid="nav-path"class="navpath"><!-- id is needed for treeview function! -->
<ul>
<liclass="footer">NATS.IO Supported By Synadia Communications Inc.