add id and name properties

This commit is contained in:
Aleix Conchillo Flaqué
2025-01-24 16:36:36 -08:00
parent 57b186cde8
commit 5885fcc230
4 changed files with 41 additions and 8 deletions

View File

@@ -41,8 +41,8 @@ class FrameProcessor:
loop: asyncio.AbstractEventLoop | None = None,
**kwargs,
):
self.id: int = obj_id()
self.name = name or f"{self.__class__.__name__}#{obj_count(self)}"
self._id: int = obj_id()
self._name = name or f"{self.__class__.__name__}#{obj_count(self)}"
self._parent: "FrameProcessor" | None = None
self._prev: "FrameProcessor" | None = None
self._next: "FrameProcessor" | None = None
@@ -83,6 +83,14 @@ class FrameProcessor:
# the exception to this rule. This create this task.
self.__create_push_task()
@property
def id(self) -> int:
return self._id
@property
def name(self) -> str:
return self._name
@property
def interruptions_allowed(self):
return self._allow_interruptions