Wait until fully disconnected before EM.stop

Stephen Paul Weber created

Change summary

lib/blather_notify.rb | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)

Detailed changes

lib/blather_notify.rb 🔗

@@ -27,10 +27,8 @@ module BlatherNotify
 	end
 
 	def self.wait_then_exit
-		EM.next_tick do
-			shutdown
-			EM.stop
-		end
+		shutdown
+		disconnected { EM.stop }
 		@thread.join
 	end
 end