Method: Mongo::CsotTimeoutHolder#remaining_timeout_sec

Defined in:
lib/mongo/csot_timeout_holder.rb

#remaining_timeout_secFloat | nil

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns the remaining seconds of the timeout set for the operation; if no timeout is set, or the timeout is 0 (means unlimited) returns nil.

Returns:

  • (Float | nil)

    Returns the remaining seconds of the timeout set for the operation; if no timeout is set, or the timeout is 0 (means unlimited) returns nil.



44
45
46
47
48
# File 'lib/mongo/csot_timeout_holder.rb', line 44

def remaining_timeout_sec
  return nil unless timeout?

  deadline - Utils.monotonic_time
end