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
45 def close(*)
46   super
47 
48   # traverse other threads and unlink respective selector
49   # WARNING: this is not thread safe, make sure that the session isn't being
50   # used anymore, or all non-main threads are stopped.
51   Thread.list.each do |th|
52     store = thread_selector_store(th)
53 
54     next unless store && store.key?(self)
55 
56     selector = store.delete(self)
57 
58     selector_close(selector)
59   end
60 end