rubysky 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gem_rbs_collection/activesupport/7.0/.rbs_meta.yaml +9 -0
- data/.gem_rbs_collection/activesupport/7.0/activesupport-7.0.rbs +140 -0
- data/.gem_rbs_collection/activesupport/7.0/activesupport-generated.rbs +11950 -0
- data/.gem_rbs_collection/activesupport/7.0/activesupport.rbs +583 -0
- data/.gem_rbs_collection/activesupport/7.0/manifest.yaml +16 -0
- data/.gem_rbs_collection/activesupport/7.0/patch.rbs +55 -0
- data/.gem_rbs_collection/ast/2.4/.rbs_meta.yaml +9 -0
- data/.gem_rbs_collection/ast/2.4/ast.rbs +73 -0
- data/.gem_rbs_collection/concurrent-ruby/1.1/.rbs_meta.yaml +9 -0
- data/.gem_rbs_collection/concurrent-ruby/1.1/array.rbs +4 -0
- data/.gem_rbs_collection/concurrent-ruby/1.1/executor.rbs +26 -0
- data/.gem_rbs_collection/concurrent-ruby/1.1/hash.rbs +4 -0
- data/.gem_rbs_collection/concurrent-ruby/1.1/map.rbs +58 -0
- data/.gem_rbs_collection/concurrent-ruby/1.1/promises.rbs +249 -0
- data/.gem_rbs_collection/concurrent-ruby/1.1/utility/processor_counter.rbs +5 -0
- data/.gem_rbs_collection/connection_pool/2.4/.rbs_meta.yaml +9 -0
- data/.gem_rbs_collection/connection_pool/2.4/connection_pool.rbs +34 -0
- data/.gem_rbs_collection/connection_pool/2.4/manifest.yaml +2 -0
- data/.gem_rbs_collection/diff-lcs/1.5/.rbs_meta.yaml +9 -0
- data/.gem_rbs_collection/diff-lcs/1.5/diff-lcs.rbs +11 -0
- data/.gem_rbs_collection/i18n/1.10/.rbs_meta.yaml +9 -0
- data/.gem_rbs_collection/i18n/1.10/backend.rbs +269 -0
- data/.gem_rbs_collection/i18n/1.10/i18n.rbs +117 -0
- data/.gem_rbs_collection/listen/3.9/.rbs_meta.yaml +9 -0
- data/.gem_rbs_collection/listen/3.9/listen.rbs +25 -0
- data/.gem_rbs_collection/listen/3.9/listener.rbs +24 -0
- data/.gem_rbs_collection/parallel/1.20/.rbs_meta.yaml +9 -0
- data/.gem_rbs_collection/parallel/1.20/parallel.rbs +86 -0
- data/.gem_rbs_collection/parser/3.2/.rbs_meta.yaml +9 -0
- data/.gem_rbs_collection/parser/3.2/manifest.yaml +7 -0
- data/.gem_rbs_collection/parser/3.2/parser.rbs +104 -0
- data/.gem_rbs_collection/parser/3.2/polyfill.rbs +4 -0
- data/.gem_rbs_collection/rainbow/3.0/.rbs_meta.yaml +9 -0
- data/.gem_rbs_collection/rainbow/3.0/global.rbs +7 -0
- data/.gem_rbs_collection/rainbow/3.0/presenter.rbs +209 -0
- data/.gem_rbs_collection/rainbow/3.0/rainbow.rbs +5 -0
- data/.gem_rbs_collection/rake/13.0/.rbs_meta.yaml +9 -0
- data/.gem_rbs_collection/rake/13.0/manifest.yaml +2 -0
- data/.gem_rbs_collection/rake/13.0/rake.rbs +28 -0
- data/.gem_rbs_collection/regexp_parser/2.8/.rbs_meta.yaml +9 -0
- data/.gem_rbs_collection/regexp_parser/2.8/regexp_parser.rbs +17 -0
- data/.gem_rbs_collection/rubocop/1.57/.rbs_meta.yaml +9 -0
- data/.gem_rbs_collection/rubocop/1.57/rubocop.rbs +34 -0
- data/.gem_rbs_collection/rubocop-ast/1.30/.rbs_meta.yaml +9 -0
- data/.gem_rbs_collection/rubocop-ast/1.30/rubocop-ast.rbs +15 -0
- data/.gem_rbs_collection/tzinfo/2.0/.rbs_meta.yaml +9 -0
- data/.gem_rbs_collection/tzinfo/2.0/manifest.yaml +7 -0
- data/.gem_rbs_collection/tzinfo/2.0/tzinfo.rbs +601 -0
- data/.rspec +3 -0
- data/.rubocop.yml +18 -0
- data/CHANGELOG.md +5 -0
- data/CODE_OF_CONDUCT.md +132 -0
- data/LICENSE.txt +21 -0
- data/README.md +39 -0
- data/Rakefile +12 -0
- data/Steepfile +32 -0
- data/lib/rubysky/client.rb +40 -0
- data/lib/rubysky/post.rb +15 -0
- data/lib/rubysky/raw/client.rb +133 -0
- data/lib/rubysky/raw/did_doc.rb +15 -0
- data/lib/rubysky/raw/embed.rb +18 -0
- data/lib/rubysky/raw/post.rb +29 -0
- data/lib/rubysky/raw/session.rb +41 -0
- data/lib/rubysky/version.rb +5 -0
- data/lib/rubysky.rb +17 -0
- data/rbs_collection.lock.yaml +232 -0
- data/rbs_collection.yaml +18 -0
- data/sig/rubysky.rbs +101 -0
- metadata +129 -0
@@ -0,0 +1,73 @@
|
|
1
|
+
module AST
|
2
|
+
interface _ToAst
|
3
|
+
def to_ast: () -> Node
|
4
|
+
end
|
5
|
+
|
6
|
+
interface _ToSym
|
7
|
+
def to_sym: () -> Symbol
|
8
|
+
end
|
9
|
+
|
10
|
+
class Node
|
11
|
+
public
|
12
|
+
|
13
|
+
attr_reader children: Array[untyped]
|
14
|
+
attr_reader hash: String
|
15
|
+
attr_reader type: Symbol
|
16
|
+
|
17
|
+
alias + concat
|
18
|
+
|
19
|
+
alias << append
|
20
|
+
|
21
|
+
def ==: (untyped other) -> bool
|
22
|
+
|
23
|
+
def append: (untyped element) -> self
|
24
|
+
|
25
|
+
alias clone dup
|
26
|
+
|
27
|
+
def concat: (_ToA[untyped] array) -> self
|
28
|
+
|
29
|
+
def dup: () -> self
|
30
|
+
|
31
|
+
def eql?: (untyped other) -> bool
|
32
|
+
|
33
|
+
def inspect: (?Integer indent) -> String
|
34
|
+
|
35
|
+
alias to_a children
|
36
|
+
|
37
|
+
def to_ast: () -> self
|
38
|
+
|
39
|
+
alias to_s to_sexp
|
40
|
+
|
41
|
+
def to_sexp: (?Integer indent) -> String
|
42
|
+
|
43
|
+
def to_sexp_array: () -> Array[untyped]
|
44
|
+
|
45
|
+
def updated: (?_ToSym? `type`, ?_ToA[untyped]? children, ?Hash[Symbol, untyped]? properties) -> self
|
46
|
+
|
47
|
+
private
|
48
|
+
|
49
|
+
def initialize: (_ToSym `type`, ?_ToA[untyped]? children, ?Hash[Symbol, untyped] properties) -> void
|
50
|
+
|
51
|
+
alias original_dup dup
|
52
|
+
end
|
53
|
+
|
54
|
+
class Processor
|
55
|
+
include Mixin
|
56
|
+
|
57
|
+
module Mixin
|
58
|
+
public
|
59
|
+
|
60
|
+
def handler_missing: (Node node) -> Node?
|
61
|
+
|
62
|
+
def process: (_ToAst? node) -> Node?
|
63
|
+
|
64
|
+
def process_all: (Array[_ToAst] nodes) -> Array[Node]
|
65
|
+
end
|
66
|
+
end
|
67
|
+
|
68
|
+
module Sexp
|
69
|
+
public
|
70
|
+
|
71
|
+
def s: (_ToSym `type`, *untyped children) -> Node
|
72
|
+
end
|
73
|
+
end
|
@@ -0,0 +1,26 @@
|
|
1
|
+
module Concurrent
|
2
|
+
module ExecutorService
|
3
|
+
interface _Task
|
4
|
+
def call: () -> void
|
5
|
+
end
|
6
|
+
|
7
|
+
def post: [A] (*A args) { (*A args) -> void } -> bool
|
8
|
+
|
9
|
+
def <<: (_Task task) -> bool
|
10
|
+
|
11
|
+
def can_overflow?: () -> bool
|
12
|
+
|
13
|
+
def serialized?: () -> bool
|
14
|
+
end
|
15
|
+
|
16
|
+
type executor = ExecutorService | :io | :fast | :immediate
|
17
|
+
|
18
|
+
def self.executor: (executor executor_identifier) -> ExecutorService
|
19
|
+
|
20
|
+
def self.global_io_executor: () -> ExecutorService
|
21
|
+
def self.global_fast_executor: () -> ExecutorService
|
22
|
+
def self.global_immediate_executor: () -> ExecutorService
|
23
|
+
|
24
|
+
def self.new_io_executor: (?Hash[Symbol, untyped] opts) -> ExecutorService
|
25
|
+
def self.new_fast_executor: (?Hash[Symbol, untyped] opts) -> ExecutorService
|
26
|
+
end
|
@@ -0,0 +1,58 @@
|
|
1
|
+
module Concurrent
|
2
|
+
class Map[unchecked out K, unchecked out V]
|
3
|
+
def initialize: (?Hash[Symbol, untyped] options) ?{ (self, untyped) -> V } -> void
|
4
|
+
|
5
|
+
def []: (untyped key) -> V?
|
6
|
+
def []=: (K key, V value) -> V
|
7
|
+
|
8
|
+
alias get []
|
9
|
+
alias put []=
|
10
|
+
|
11
|
+
def fetch: (untyped key) -> V
|
12
|
+
| [D] (untyped key, D default_value) -> (V | D)
|
13
|
+
| [T, D] (T key) { (T key) -> D } -> (V | D)
|
14
|
+
|
15
|
+
def fetch_or_store: (untyped key) -> V
|
16
|
+
| (K key, V default_value) -> V
|
17
|
+
| (K key) { (K key) -> V } -> V
|
18
|
+
|
19
|
+
def put_if_absent: (K key, V value) -> V?
|
20
|
+
|
21
|
+
def value?: (untyped value) -> bool
|
22
|
+
|
23
|
+
def keys: () -> Array[K]
|
24
|
+
|
25
|
+
def values: () -> Array[V]
|
26
|
+
|
27
|
+
def each_key: () { (K key) -> void } -> self
|
28
|
+
|
29
|
+
def each_value: () { (V value) -> void } -> self
|
30
|
+
|
31
|
+
def each_pair: () { (K key, V value) -> void } -> self
|
32
|
+
|
33
|
+
alias each each_pair
|
34
|
+
|
35
|
+
def key: (untyped value) -> K?
|
36
|
+
|
37
|
+
def empty?: () -> bool
|
38
|
+
|
39
|
+
def size: () -> Integer
|
40
|
+
|
41
|
+
def marshal_dump: () -> Hash[K, V]
|
42
|
+
def marshal_load: (Hash[K, V] hash) -> self
|
43
|
+
|
44
|
+
# undef :freeze
|
45
|
+
|
46
|
+
def inspect: () -> String
|
47
|
+
|
48
|
+
private
|
49
|
+
|
50
|
+
def raise_fetch_no_key: () -> bot
|
51
|
+
|
52
|
+
def initialize_copy: (instance other) -> void
|
53
|
+
|
54
|
+
def populate_from: (Hash[K, V] hash) -> self
|
55
|
+
|
56
|
+
def validate_options_hash!: (Hash[Symbol, untyped] options) -> void
|
57
|
+
end
|
58
|
+
end
|
@@ -0,0 +1,249 @@
|
|
1
|
+
module Concurrent
|
2
|
+
module Promises
|
3
|
+
module FactoryMethods
|
4
|
+
def any_event: (*(Event | Future[top, top]) futures_and_or_events) -> Event
|
5
|
+
def any_event_on: (executor default_executor, *(Event | Future[top, top]) futures_and_or_events) -> Event
|
6
|
+
|
7
|
+
def any_fulfilled_future: (*Event events) -> Future[nil, bot]
|
8
|
+
| [T, E] (*Future[T, E] futures) -> Future[T, E]
|
9
|
+
| [T, E] (*(Event | Future[T, E]) futures_and_or_events) -> Future[T | nil, E]
|
10
|
+
def any_fulfilled_future_on: (executor default_executor, *Event events) -> Future[nil, bot]
|
11
|
+
| [T, E] (executor default_executor, *Future[T, E] futures) -> Future[T, E]
|
12
|
+
| [T, E] (executor default_executor, *(Event | Future[T, E]) futures_and_or_events) -> Future[T | nil, E]
|
13
|
+
|
14
|
+
def any_resolved_future: (*Event events) -> Future[nil, bot]
|
15
|
+
| [T, E] (*Future[T, E] futures) -> Future[T, E]
|
16
|
+
| [T, E] (*(Event | Future[T, E]) futures_and_or_events) -> Future[T | nil, E]
|
17
|
+
alias any any_resolved_future
|
18
|
+
def any_resolved_future_on: (executor default_executor, *Event events) -> Future[nil, bot]
|
19
|
+
| [T, E] (executor default_executor, *Future[T, E] futures) -> Future[T, E]
|
20
|
+
| [T, E] (executor default_executor, *(Event | Future[T, E]) futures_and_or_events) -> Future[T | nil, E]
|
21
|
+
|
22
|
+
def default_executor: () -> executor
|
23
|
+
|
24
|
+
def delay: () -> Event
|
25
|
+
| [A, T] (*A args) { (*A args) -> T } -> Future[T, Exception]
|
26
|
+
def delay_on: (executor default_executor) -> Event
|
27
|
+
| [A, T] (executor default_executor, *A args) { (*A args) -> T } -> Future[T, Exception]
|
28
|
+
|
29
|
+
def fulfilled_future: [T] (T value, ?executor default_executor) -> Future[T, bot]
|
30
|
+
|
31
|
+
def future: [A, T] (*A args) { (*A args) -> T } -> Future[T, Exception]
|
32
|
+
def future_on: [A, T] (executor default_executor, *A args) { (*A args) -> T } -> Future[T, Exception]
|
33
|
+
|
34
|
+
def make_future: (nil, ?executor default_executor) -> Event
|
35
|
+
| [X < AbstractEventFuture] (X event_or_future, ?executor default_executor) -> X
|
36
|
+
| [E < Exception] (E reason, ?executor default_executor) -> Future[bot, E]
|
37
|
+
| [T] (T value, ?executor default_executor) -> Future[T, bot]
|
38
|
+
|
39
|
+
def rejected_future: [E] (E reason, ?executor default_executor) -> Future[bot, E]
|
40
|
+
|
41
|
+
def resolvable_event: () -> ResolvableEvent
|
42
|
+
def resolvable_event_on: (executor default_executor) -> ResolvableEvent
|
43
|
+
|
44
|
+
def resolvable_future: () -> ResolvableFuture[untyped, untyped]
|
45
|
+
def resolvable_future_on: (executor default_executor) -> ResolvableFuture[untyped, untyped]
|
46
|
+
|
47
|
+
def resolved_event: (?executor default_executor) -> Event
|
48
|
+
|
49
|
+
def resolved_future: [T] (true fulfilled, T value, top reason, ?executor default_executor) -> Future[T, bot]
|
50
|
+
| [E] (false fulfilled, top value, E reason, ?executor default_executor) -> Future[bot, E]
|
51
|
+
| [T, E] (boolish fulfilled, T? value, E? reason, ?executor default_executor) -> Future[T, E]
|
52
|
+
|
53
|
+
def schedule: (Numeric | Time intended_time) -> Event
|
54
|
+
| [A, T] (Numeric | Time intended_time, *A args) { (*A args) -> T } -> Future[T, Exception]
|
55
|
+
def schedule_on: (executor default_executor, Numeric | Time intended_time) -> Event
|
56
|
+
| [A, T] (executor default_executor, Numeric | Time intended_time, *A args) { (*A args) -> T } -> Future[T, Exception]
|
57
|
+
|
58
|
+
def zip_events: (*(Event | Future[top, top]) futures_and_or_events) -> Event
|
59
|
+
def zip_events_on: (executor default_executor, *(Event | Future[top, top]) futures_and_or_events) -> Event
|
60
|
+
|
61
|
+
def zip_futures: (*Event events) -> Future[::Array[nil], bot]
|
62
|
+
| [T, E] (*Future[T, E] futures) -> Future[::Array[T], ::Array[E]]
|
63
|
+
| [T, E] (*(Event | Future[T, E]) futures_and_or_events) -> Future[::Array[T | nil], ::Array[E | nil]]
|
64
|
+
alias zip zip_futures
|
65
|
+
def zip_futures_on: (executor default_executor, *Event events) -> Future[Array[nil], bot]
|
66
|
+
| [T, E] (executor default_executor, *Future[T, E] futures) -> Future[Array[T], Array[E]]
|
67
|
+
| [T, E] (executor default_executor, *(Event | Future[T, E]) futures_and_or_events) -> Future[Array[T | nil], Array[E]]
|
68
|
+
end
|
69
|
+
|
70
|
+
extend FactoryMethods
|
71
|
+
|
72
|
+
class AbstractEventFuture
|
73
|
+
def chain: [A, U] (*A args) { (*untyped) -> U } -> Future[U, Exception]
|
74
|
+
def chain_on: [A, U] (executor executor, *A args) { (*untyped) -> U } -> Future[U, Exception]
|
75
|
+
|
76
|
+
def chain_resolvable: (Resolvable resolvable) -> self
|
77
|
+
alias tangle chain_resolvable
|
78
|
+
|
79
|
+
def default_executor: () -> executor
|
80
|
+
|
81
|
+
def internal_state: () -> Object
|
82
|
+
|
83
|
+
def on_resolution: [A] (*A args) { (*untyped) -> void } -> self
|
84
|
+
def on_resolution!: [A] (*A args) { (*untyped) -> void } -> self
|
85
|
+
def on_resolution_using: [A] (executor executor, *A args) { (*untyped) -> void } -> self
|
86
|
+
|
87
|
+
def resolved?: () -> bool
|
88
|
+
|
89
|
+
def pending?: () -> bool
|
90
|
+
|
91
|
+
def state: () -> Symbol
|
92
|
+
|
93
|
+
def touch: () -> self
|
94
|
+
|
95
|
+
def wait: (?nil) -> self
|
96
|
+
| (Numeric timeout) -> bool
|
97
|
+
end
|
98
|
+
|
99
|
+
class Event < AbstractEventFuture
|
100
|
+
def any: (Event | Future[top, top] event_or_future) -> Event
|
101
|
+
alias | any
|
102
|
+
|
103
|
+
def delay: () -> Event
|
104
|
+
|
105
|
+
def schedule: (Numeric | Time intended_time) -> Event
|
106
|
+
|
107
|
+
def to_event: () -> self
|
108
|
+
|
109
|
+
def to_future: () -> Future[nil, bot]
|
110
|
+
|
111
|
+
def with_default_executor: (executor executor) -> Event
|
112
|
+
|
113
|
+
def zip: (Event event) -> Event
|
114
|
+
| [T, E] (Future[T, E] future) -> Future[T, E]
|
115
|
+
alias & zip
|
116
|
+
|
117
|
+
|
118
|
+
## Following methods are actually defined in the base class and have specific types for Event
|
119
|
+
|
120
|
+
def chain: [A, U] (*A args) { (*A args) -> U } -> Future[U, Exception]
|
121
|
+
def chain_on: [A, U] (executor executor, *A args) { (*A args) -> U } -> Future[U, Exception]
|
122
|
+
|
123
|
+
def on_resolution: [A] (*A args) { (*A args) -> void } -> self
|
124
|
+
def on_resolution!: [A] (*A args) { (*A args) -> void } -> self
|
125
|
+
def on_resolution_using: [A] (executor executor, *A args) { (*A args) -> void } -> self
|
126
|
+
|
127
|
+
def state: () -> (:pending | :resolved)
|
128
|
+
end
|
129
|
+
|
130
|
+
class Future[out T, out E] < AbstractEventFuture
|
131
|
+
def any: (Event event) -> Future[T | nil, E]
|
132
|
+
| [T2, E2] (Future[T2, E2] future) -> Future[T | T2, E | E2]
|
133
|
+
alias | any
|
134
|
+
|
135
|
+
def delay: () -> Future[T, E]
|
136
|
+
|
137
|
+
def exception: () -> Exception # TODO: Return type can be narrowed to E when E <: Exception
|
138
|
+
|
139
|
+
def flat_event: () -> Event
|
140
|
+
|
141
|
+
def flat_future: (?Integer level) -> untyped # TODO: Valid only if T <: Future[top, top]
|
142
|
+
alias flat flat_future
|
143
|
+
|
144
|
+
def fulfilled?: () -> bool
|
145
|
+
|
146
|
+
def on_fulfillment: [A] (*A args) { (T value, *A args) -> void } -> self
|
147
|
+
def on_fulfillment!: [A] (*A args) { (T value, *A args) -> void } -> self
|
148
|
+
def on_fulfillment_using: [A] (executor executor, *A args) { (T value, A args) -> void } -> self
|
149
|
+
|
150
|
+
def on_rejection: [A] (*A args) { (E reason, *A args) -> void } -> self
|
151
|
+
def on_rejection!: [A] (*A args) { (E reason, *A args) -> void } -> self
|
152
|
+
def on_rejection_using: [A] (executor executor, *A args) { (E reason, A args) -> void } -> self
|
153
|
+
|
154
|
+
def reason: (?Numeric timeout) -> (E | nil)
|
155
|
+
| [R] (Numeric timeout, R timeout_value) -> (E | R | nil)
|
156
|
+
|
157
|
+
def rejected?: () -> bool
|
158
|
+
|
159
|
+
def rescue: [A, U] (*A args) { (E reason, *A args) -> U } -> Future[U, Exception]
|
160
|
+
def rescue_on: [A, U] (executor executor, *A args) { (E reason, *A args) -> U } -> Future[U, Exception]
|
161
|
+
|
162
|
+
def result: (?nil) -> ([true, T, nil] | [false, nil, E])
|
163
|
+
| (Numeric timeout) -> ([true, T, nil] | [false, nil, E] | nil)
|
164
|
+
|
165
|
+
def run: (?^(untyped) -> Future[untyped, untyped]? run_test) -> Future[untyped, untyped] # TODO: Any specific type?
|
166
|
+
|
167
|
+
def schedule: (Numeric | Time intended_time) -> Future[T, E]
|
168
|
+
|
169
|
+
def then: [A, U] (*A args) { (T value, *A args) -> U } -> Future[U, E | Exception]
|
170
|
+
def then_on: [A, U] (executor executor, *A args) { (T value, *A args) -> U } -> Future[U, E | Exception]
|
171
|
+
|
172
|
+
def to_event: () -> Event
|
173
|
+
|
174
|
+
def to_future: () -> self
|
175
|
+
|
176
|
+
def value: (?Numeric timeout) -> (T | nil)
|
177
|
+
| [R] (Numeric timeout, R timeout_value) -> (T | R | nil)
|
178
|
+
def value!: (?nil) -> T
|
179
|
+
| (Numeric timeout) -> (T | nil)
|
180
|
+
| [R] (Numeric timeout, R timeout_value) -> (T | R | nil)
|
181
|
+
|
182
|
+
def wait!: (?nil) -> self
|
183
|
+
| (Numeric timeout) -> bool
|
184
|
+
|
185
|
+
def with_default_executor: (executor executor) -> Future[T, E]
|
186
|
+
|
187
|
+
def zip: (Event event) -> Future[T, E]
|
188
|
+
| [T2, E2] (Future[T2, E2] future) -> Future[[T, T2], [E, E2]]
|
189
|
+
alias & zip
|
190
|
+
|
191
|
+
|
192
|
+
## Following methods are actually defined in the base class and have specific types for Future
|
193
|
+
|
194
|
+
def chain: [A, U] (*A args) { (bool fulfilled, T? value, E? reason, *A args) -> U } -> Future[U, Exception]
|
195
|
+
def chain_on: [A, U] (executor executor, *A args) { (bool fulfilled, T? value, E? reason, *A args) -> U } -> Future[U, Exception]
|
196
|
+
|
197
|
+
def on_resolution: [A] (*A args) { (bool fulfilled, T? value, E? reason, *A args) -> void } -> self
|
198
|
+
def on_resolution!: [A] (*A args) { (bool fulfilled, T? value, E? reason, *A args) -> void } -> self
|
199
|
+
def on_resolution_using: [A] (executor executor, *A args) { (bool fulfilled, T? value, E? reason, *A args) -> void } -> self
|
200
|
+
|
201
|
+
def state: () -> (:pending | :fulfilled | :rejected)
|
202
|
+
end
|
203
|
+
|
204
|
+
module Resolvable
|
205
|
+
end
|
206
|
+
|
207
|
+
class ResolvableEvent < Event
|
208
|
+
include Resolvable
|
209
|
+
|
210
|
+
def resolve: (?true raise_on_reassign, ?boolish reserved) -> self
|
211
|
+
| (boolish raise_on_reassign, ?boolish reserved) -> (self | false)
|
212
|
+
|
213
|
+
def wait: (Numeric timeout, boolish resolve_on_timeout) -> bool
|
214
|
+
| ...
|
215
|
+
|
216
|
+
def with_hidden_resolvable: () -> Event
|
217
|
+
end
|
218
|
+
|
219
|
+
class ResolvableFuture[T, E] < Future[T, E] # Note: ResolvableFuture is invariant on T and E
|
220
|
+
include Resolvable
|
221
|
+
|
222
|
+
def evalute_to: [A] (*A args) { (*A args) -> T } -> self # TODO: Unsound unless E :> Exception
|
223
|
+
def evalute_to!: [A] (*A args) { (*A args) -> T } -> self # TODO: ditto
|
224
|
+
|
225
|
+
def fulfill: (T value, ?true raise_on_reassign, ?boolish reserved) -> self
|
226
|
+
| (T value, boolish raise_on_reassign, ?boolish reserved) -> (self | false)
|
227
|
+
|
228
|
+
def reason: [R] (Numeric timeout, R timeout_value, [boolish, T?, E?] resolve_on_timeout) -> (E | R | nil)
|
229
|
+
| ...
|
230
|
+
|
231
|
+
def reject: (E reason, ?true raise_on_reassign, ?boolish reserved) -> self
|
232
|
+
| (E reason, boolish raise_on_reassign, ?boolish reserved) -> (self | false)
|
233
|
+
|
234
|
+
def resolve: (?boolish fulfilled, ?T? value, ?E? reason, ?true raise_on_reassign, ?boolish reserved) -> self
|
235
|
+
| (boolish fulfilled, T? value, E? reason, boolish raise_on_reassign, ?boolish reserved) -> (self | false)
|
236
|
+
|
237
|
+
def result: (Numeric timeout, [boolish, T?, E?] resolve_on_timeout) -> ([true, T, nil] | [false, nil, E] | nil)
|
238
|
+
| ...
|
239
|
+
|
240
|
+
def value: [R] (Numeric timeout, R timeout_value, [boolish, T?, E?] resolve_on_timeout) -> (T | R | nil)
|
241
|
+
| ...
|
242
|
+
|
243
|
+
def value!: [R] (Numeric timeout, R timeout_value, [boolish, T?, E?] resolve_on_timeout) -> (T | R | nil)
|
244
|
+
| ...
|
245
|
+
|
246
|
+
def with_hidden_resolvable: () -> Future[T, E]
|
247
|
+
end
|
248
|
+
end
|
249
|
+
end
|
@@ -0,0 +1,34 @@
|
|
1
|
+
class ConnectionPool[T]
|
2
|
+
class Error < ::RuntimeError
|
3
|
+
end
|
4
|
+
|
5
|
+
class PoolShuttingDownError < ::ConnectionPool::Error
|
6
|
+
end
|
7
|
+
|
8
|
+
class TimeoutError < ::Timeout::Error
|
9
|
+
end
|
10
|
+
|
11
|
+
class Wrapper[T]
|
12
|
+
def initialize: (pool: ConnectionPool[T]) -> void
|
13
|
+
| (?size: Integer, ?timeout: Numeric, ?auto_reload_after_fork: bool) { () -> T } -> void
|
14
|
+
def wrapped_pool: () -> ConnectionPool[T]
|
15
|
+
def with: [A] () { (T) -> A } -> A
|
16
|
+
def pool_shutdown: () { (T) -> void } -> void
|
17
|
+
def pool_size: () -> Integer
|
18
|
+
def pool_available: () -> Integer
|
19
|
+
end
|
20
|
+
|
21
|
+
def initialize: (?size: Integer, ?timeout: Numeric, ?auto_reload_after_fork: bool) { () -> T } -> void
|
22
|
+
def with: [A] (?timeout: Numeric) { (T) -> A } -> A
|
23
|
+
def checkout: (?timeout: Numeric) -> T
|
24
|
+
def checkin: (?force: bool) -> void
|
25
|
+
def shutdown: () { (T) -> void } -> void
|
26
|
+
def reload: () { (T) -> void } -> void
|
27
|
+
|
28
|
+
attr_reader size: Integer
|
29
|
+
attr_reader auto_reload_after_fork: bool
|
30
|
+
|
31
|
+
def available: () -> Integer
|
32
|
+
|
33
|
+
alias then with
|
34
|
+
end
|
@@ -0,0 +1,11 @@
|
|
1
|
+
module Diff
|
2
|
+
end
|
3
|
+
|
4
|
+
module Diff::LCS
|
5
|
+
def self.LCS: (Array[String], Array[String]) -> Array[String]
|
6
|
+
| (String, String) -> Array[String]
|
7
|
+
def self.diff: (Array[String], Array[String]) -> Array[String]
|
8
|
+
| (String, String) -> Array[String]
|
9
|
+
|
10
|
+
def self.patch!: (Array[String], Array[String]) -> String
|
11
|
+
end
|