You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<td>Gracefully closes all open sessions, then shuts down the connection</td></tr>
607
+
<trclass="a">
608
+
<td><code>forceStop()</code></td>
609
+
<td>Immediately clears sessions and shuts down — no graceful session cleanup</td></tr></tbody>
610
+
</table>
611
+
612
+
<p>Use <code>stop()</code> for normal shutdown — it ensures each session is properly closed (flushing pending operations) before terminating the connection:</p>
613
+
614
+
<preclass="prettyprint"><codeclass="language-java">// Graceful: closes all sessions, then disconnects
615
+
client.stop().get();
616
+
</code></pre>
617
+
<p>Use <code>forceStop()</code> when you need to terminate immediately, such as during error recovery or when the server is unresponsive:</p>
<p><strong>Tip:</strong> In <code>try-with-resources</code> blocks, <code>close()</code> delegates to <code>stop()</code>, so graceful cleanup happens automatically.</p>
<p>Subscribe to lifecycle events to be notified when sessions are created, deleted, updated, or change foreground/background state.</p><section><aid="Subscribing_to_All_Lifecycle_Events"></a>
0 commit comments