class documentation
class ResourceLimit(object): (source)
Constructor: ResourceLimit(limit, soft, hard, warn_on_failure)
Context manager that allows for a temporary change to a resource limit exposed by the resource package.
Example:
import resource import fiftyone.core.utils as fou with fou.ResourceLimit(resource.RLIMIT_NOFILE, soft=4096): # temporarily do things with up to 4096 open files Args: limit: the name of the resource to limit. Must be the name of a constant in the ``resource`` module starting with ``RLIMIT``. See the documentation of the ``resource`` module for supported values soft (None): a new soft limit to apply, which cannot exceed the hard limit. If omitted, the current soft limit is maintained hard (None): a new hard limit to apply. If omitted, the current hard limit is maintained warn_on_failure (False): whether to issue a warning rather than an error if the resource limit change is not successful
Method | __enter__ |
Undocumented |
Method | __exit__ |
Undocumented |
Method | __init__ |
Undocumented |
Instance Variable | _hard |
Undocumented |
Instance Variable | _hard |
Undocumented |
Instance Variable | _limit |
Undocumented |
Instance Variable | _soft |
Undocumented |
Instance Variable | _soft |
Undocumented |
Instance Variable | _supported |
Undocumented |
Instance Variable | _warn |
Undocumented |