Utils

class pomice.utils.ExponentialBackoff(base: int = 1, *, integral: bool = False)[source]

Bases: object

The MIT License (MIT) Copyright (c) 2015-present Rapptz Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

delay() float[source]
class pomice.utils.FailingIPBlock(data: dict)[source]

Bases: object

The base class for the failing IP block object from the route planner stats. Gives critical information about any failing addresses on the block and the time they failed.

address
failing_time
class pomice.utils.LavalinkVersion(major, minor, fix)[source]

Bases: tuple

fix: int

Alias for field number 2

major: int

Alias for field number 0

minor: int

Alias for field number 1

class pomice.utils.NodeStats(data: Dict[str, Any])[source]

Bases: object

The base class for the node stats object. Gives critical information on the node, which is updated every minute.

allocated
cpu_cores
cpu_process_load
cpu_system_load
free
players_active
players_total
reservable
uptime
used
class pomice.utils.Ping(host: str, port: int, timeout: int = 5)[source]

Bases: object

class Socket(family: int, type_: int, timeout: float | None)[source]

Bases: object

close() None
connect(host: str, port: int) None
shutdown() None
class Timer[source]

Bases: object

cost(funcs: Iterable[Callable], args: Any) float
start() None
stop() None
get_ping() float[source]
class pomice.utils.RouteStats(data: Dict[str, Any])[source]

Bases: object

The base class for the route planner stats object. Gives critical information about the route planner strategy on the node.

address_index
block_index
failing_addresses
ip_block_size
ip_block_type
strategy