class IdleGC::Request

Defined in:

idle-gc/request.cr

Constant Summary

DEFAULT_REQUEST_LIMIT = 1_u64
DEFAULT_SYNCHRONOUS = false

Class Method Summary

Class Method Detail

def self.request(incr : UInt64 = 1) : Bool #

[View source]
def self.request_count : UInt64 #

Return the current request count.


[View source]
def self.request_limit : UInt64 #

Return the current request limit.


[View source]
def self.request_limit=(v : UInt64) : Nil #

Set the request limit.

(Merely setting the request limit will not cause garbage collection to fire.)


[View source]
def self.synchronous : Bool #

Returns false (default) if garbage collection happens in the background. Returns true if garbage collection happens synchronously.


[View source]
def self.synchronous=(v : Bool) : Nil #

Set synchronous=true to force garbage collection to happen synchronously when the request_limit is exceeded.

If synchronous=false, a background collection will be scheduled, but will wait until the system is idle.

Use synchronous=false for interactive systems, and synchronous=true for non-interactive batch processes.


[View source]