Notify observers of a change in state if this object’s changed state is true
.
This will invoke the method named in add_observer
, passing *arg
. The changed state is then set to false
.
*arg
Any arguments to pass to the observers.
Returns the time resolution returned by POSIX clock_getres
() function.
clock_id
specifies a kind of clock. See the document of Process.clock_gettime
for details.
clock_id
can be a symbol as Process.clock_gettime
. However the result may not be accurate. For example, +Process.clock_getres(:GETTIMEOFDAY_BASED_CLOCK_REALTIME)+ returns 1.0e-06 which means 1 microsecond, but actual resolution can be more coarse.
If the given clock_id
is not supported, Errno::EINVAL is raised.
unit
specifies a type of the return value. Process.clock_getres
accepts unit
as Process.clock_gettime
. The default value, :float_second
, is also same as Process.clock_gettime
.
Process.clock_getres
also accepts :hertz
as unit
. :hertz
means a the reciprocal of :float_second
.
:hertz
can be used to obtain the exact value of the clock ticks per second for times() function and CLOCKS_PER_SEC for clock() function.
+Process.clock_getres(:TIMES_BASED_CLOCK_PROCESS_CPUTIME_ID, :hertz)+ returns the clock ticks per second.
+Process.clock_getres(:CLOCK_BASED_CLOCK_PROCESS_CPUTIME_ID, :hertz)+ returns CLOCKS_PER_SEC.
p Process.clock_getres(Process::CLOCK_MONOTONIC) #=> 1.0e-09
The line number in the source code where this AST’s text began.
The line number in the source code where this AST’s text ended.
Adds session to the session cache.
Initiates the SSL/TLS handshake as a server in non-blocking manner.
# emulates blocking accept begin ssl.accept_nonblock rescue IO::WaitReadable IO.select([s2]) retry rescue IO::WaitWritable IO.select(nil, [s2]) retry end
By specifying a keyword argument exception to false
, you can indicate that accept_nonblock
should not raise an IO::WaitReadable
or IO::WaitWritable
exception, but return the symbol :wait_readable
or :wait_writable
instead.
Writes string to the SSL
connection in a non-blocking manner. Raises an SSLError
if writing would block.
Returns the ALPN protocol string that was finally selected by the server during the handshake.
Returns the protocol string that was finally selected by the client during the handshake.
Returns the error string corresponding to the error code retrieved by error
.