Skip to content

Commit dc60766

Browse files
author
Andrei Neagu
committed
renaming
1 parent 4e8bce9 commit dc60766

File tree

1 file changed

+7
-7
lines changed
  • services/dynamic-scheduler/src/simcore_service_dynamic_scheduler/api/ui

1 file changed

+7
-7
lines changed

services/dynamic-scheduler/src/simcore_service_dynamic_scheduler/api/ui/_sse_utils.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,11 @@ def changes_detected(self, last_update_id: UpdateID) -> bool:
4343

4444
@staticmethod
4545
@abstractmethod
46-
def render_item(item: Any) -> AnyComponent:
46+
def get_component(item: Any) -> AnyComponent:
4747
"""returns a `fastui.component` to which renders the content of the item"""
4848

49-
def get_messages(self) -> tuple[UpdateID, list[AnyComponent]]:
50-
return self._get_update_id(), [self.render_item(x) for x in self._items]
49+
def get_components(self) -> tuple[UpdateID, list[AnyComponent]]:
50+
return self._get_update_id(), [self.get_component(x) for x in self._items]
5151

5252

5353
class RendererManager(SingletonInAppStateMixin):
@@ -106,19 +106,19 @@ async def render_items_on_change(
106106
"""
107107

108108
async with renderer_type(app) as renderer:
109-
last_update_id, messages = renderer.get_messages()
109+
last_update_id, components = renderer.get_components()
110110

111111
# render current state
112-
yield f"data: {FastUI(root=messages).model_dump_json(by_alias=True, exclude_none=True)}\n\n"
112+
yield f"data: {FastUI(root=components).model_dump_json(by_alias=True, exclude_none=True)}\n\n"
113113

114114
# Avoid the browser reconnecting
115115
while True:
116116
await asyncio.sleep(check_interval)
117117

118-
update_id, messages = renderer.get_messages()
118+
update_id, components = renderer.get_components()
119119

120120
if renderer.changes_detected(last_update_id=last_update_id):
121-
yield f"data: {FastUI(root=messages).model_dump_json(by_alias=True, exclude_none=True)}\n\n"
121+
yield f"data: {FastUI(root=components).model_dump_json(by_alias=True, exclude_none=True)}\n\n"
122122

123123
last_update_id = update_id
124124

0 commit comments

Comments
 (0)