module HTTPX::Plugins::Persistent::InstanceMethods

  1. lib/httpx/plugins/persistent.rb

Methods

Public Instance

  1. close

Public Instance methods

close(*)
[show source]
   # File lib/httpx/plugins/persistent.rb
39 def close(*)
40   super
41 
42   # traverse other threads and unlink respective selector
43   # WARNING: this is not thread safe, make sure that the session isn't being
44   # used anymore, or all non-main threads are stopped.
45   Thread.list.each do |th|
46     store = thread_selector_store(th)
47 
48     next unless store && store.key?(self)
49 
50     selector = store.delete(self)
51 
52     selector_close(selector)
53   end
54 end