-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathtimers.rbs
45 lines (27 loc) · 869 Bytes
/
timers.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
45
module HTTPX
class Timers
@intervals: Array[Interval]
@next_interval_at: Float
def after: (Numeric interval_in_secs, ^() -> void) -> Interval
| (Numeric interval_in_secs) { () -> void } -> Interval
def wait_interval: () -> Numeric?
def fire: (?TimeoutError error) -> void
def initialize: () -> void
class Interval
include Comparable
type callback = ^() -> void
attr_reader interval: Numeric
@callbacks: Array[callback]
@on_empty: callback?
def on_empty: () { () -> void } -> void
def to_f: () -> Float
def <<: (callback) -> void
def delete: (callback) -> void
def elapse: (Numeric elapsed) -> Numeric
def elapsed?: () -> bool
def no_callbacks?: () -> bool
private
def initialize: (Numeric interval) -> void
end
end
end