lib/protonbot/plug.rb in protonbot-0.2.1 vs lib/protonbot/plug.rb in protonbot-0.2.2

- old
+ new

@@ -96,12 +96,10 @@ log.info("Started plug `#{name}` successfully!") introduce - @rloop.join - @wloop.join self end # Logs given error object to cosole # @param e [Exception] @@ -117,7 +115,20 @@ end # @return [String] out def inspect %(<#ProtonBot::Plug:#{object_id.to_s(16)} @name=#{name} @bot=#{bot}>) + end + + # @!api private + def thrjoin + until @rloop && @rloop.status == 'run' + sleep(0.1) + end + until @wloop && @wloop.status == 'run' + sleep(0.1) + end + @bot.plugthrs[@name].join + @rloop.join + @wloop.join end end