File tree Expand file tree Collapse file tree 1 file changed +18
-11
lines changed
google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1 Expand file tree Collapse file tree 1 file changed +18
-11
lines changed Original file line number Diff line number Diff line change @@ -296,7 +296,7 @@ protected void doStart() {
296296 @ Override
297297 public void run () {
298298 try {
299- startStreamingConnections ();
299+ startStreamingConnections ();
300300 notifyStarted ();
301301 } catch (Throwable t ) {
302302 notifyFailed (t );
@@ -308,16 +308,23 @@ public void run() {
308308
309309 @ Override
310310 protected void doStop () {
311- // stop connection is no-op if connections haven't been started.
312- stopAllStreamingConnections ();
313- try {
314- for (AutoCloseable closeable : closeables ) {
315- closeable .close ();
316- }
317- notifyStopped ();
318- } catch (Exception e ) {
319- notifyFailed (e );
320- }
311+ new Thread (
312+ new Runnable () {
313+ @ Override
314+ public void run () {
315+ try {
316+ // stop connection is no-op if connections haven't been started.
317+ stopAllStreamingConnections ();
318+ for (AutoCloseable closeable : closeables ) {
319+ closeable .close ();
320+ }
321+ notifyStopped ();
322+ } catch (Exception e ) {
323+ notifyFailed (e );
324+ }
325+ }
326+ })
327+ .start ();
321328 }
322329
323330 private void startStreamingConnections () throws IOException {
You can’t perform that action at this time.
0 commit comments