Skip to content

Commit

Permalink
Make Fiber.timeout and .cancel_timeout nodoc (#15184)
Browse files Browse the repository at this point in the history
  • Loading branch information
straight-shoota authored Nov 14, 2024
1 parent 2725705 commit 9ca69ad
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/fiber.cr
Original file line number Diff line number Diff line change
Expand Up @@ -246,12 +246,15 @@ class Fiber
@timeout_event.try &.delete
end

# :nodoc:
#
# The current fiber will resume after a period of time.
# The timeout can be cancelled with `cancel_timeout`
def self.timeout(timeout : Time::Span, select_action : Channel::TimeoutAction) : Nil
Fiber.current.timeout(timeout, select_action)
end

# :nodoc:
def self.cancel_timeout : Nil
Fiber.current.cancel_timeout
end
Expand Down

0 comments on commit 9ca69ad

Please sign in to comment.