sig/timers.rbs in httpx-1.0.2 vs sig/timers.rbs in httpx-1.1.0

- old
+ new

@@ -1,33 +1,43 @@ module HTTPX class Timers @intervals: Array[Interval] @next_interval_at: Float - def after: (Numeric interval_in_secs) { () -> void } -> void + def after: (Numeric interval_in_secs, ^() -> void) -> Interval + | (Numeric interval_in_secs) { () -> void } -> Interval def wait_interval: () -> Numeric? def fire: (?TimeoutError error) -> void - def cancel: () -> void - - private - def initialize: () -> void class Interval include Comparable + type callback = ^() -> void + attr_reader interval: Numeric - @callbacks: Array[^() -> void] + @callbacks: Array[callback] + @on_empty: callback? + + def on_empty: () { () -> void } -> void + def to_f: () -> Float - def <<: (^() -> void) -> void + 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 \ No newline at end of file