emulators.rom_cache._Budget
Paces a copy to a rate cap and enforces its deadline, one chunk at a time.
Paces a copy to a rate cap and enforces its deadline, one chunk at a time.
Functions
func__init__(self, mbps, timeout) -> NoneStart the clock.
paramselfparammbpsfloatSpeed cap in MB/s, or 0 for none.
paramtimeoutOptional[float]Seconds the whole copy may take, or None for no limit.
Returns
Nonefuncspend(self, n) -> NoneAccount for n more bytes copied, sleeping when ahead of the cap.
Raises
TimeoutError: When the copy has run past its deadline.
paramselfparamnintBytes just written.
Returns
None