-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathpool.rbs
44 lines (30 loc) · 1.26 KB
/
pool.rbs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
module HTTPX
type pool_options = {
max_connections_per_origin: Integer?,
pool_timeout: Numeric?
}
class Pool
type resolver_manager = Resolver::Multi | Resolver::System
@max_connections_per_origin: Integer
@pool_timeout: Numeric
@options: Options
@resolvers: Hash[Class, Array[resolver_manager]]
@resolver_mtx: Thread::Mutex
@connections: Hash[String, Array[Connection]]
@connection_mtx: Thread::Mutex
@origin_counters: Hash[String, Integer]
@origin_conds: Hash[String, ConditionVariable]
def pop_connection: () -> Connection?
def checkout_connection: (http_uri uri, Options options) -> Connection
def checkin_connection: (Connection connection) -> void
def checkout_mergeable_connection: (Connection connection) -> Connection?
def reset_resolvers: () -> void
def checkout_resolver: (Options options) -> resolver_manager
def checkin_resolver: (Resolver::Resolver resolver) -> void
private
def initialize: (pool_options options) -> void
def acquire_connection: (http_uri uri, Options options) -> Connection?
def checkout_new_connection: (http_uri uri, Options options) -> Connection
def checkout_new_resolver: (Class resolver_type, Options options) -> resolver_manager
end
end