mirror of
https://github.com/varun-r-mallya/py-libp2p.git
synced 2025-12-31 20:36:24 +00:00
19 lines
325 B
Python
19 lines
325 B
Python
# Copied from https://github.com/ethereum/async-service
|
|
|
|
from typing import (
|
|
NamedTuple,
|
|
)
|
|
|
|
|
|
class TaskStats(NamedTuple):
|
|
total_count: int
|
|
finished_count: int
|
|
|
|
@property
|
|
def pending_count(self) -> int:
|
|
return self.total_count - self.finished_count
|
|
|
|
|
|
class Stats(NamedTuple):
|
|
tasks: TaskStats
|