Skip to content

Commit

Permalink
Update asynchornous application class name
Browse files Browse the repository at this point in the history
  • Loading branch information
YooSunYoung committed Dec 13, 2024
1 parent 05ac23d commit 779cd43
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions src/appstract/asyncs.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,8 +151,8 @@ async def send_message_async(self, message: MessageProtocol) -> None:
await asyncio.sleep(0)


class Application(LogMixin):
"""Application class.
class AsyncApplication(LogMixin):
"""Asynchronous Application class.
Main Responsibilities:
- Create/retrieve event loop if needed.
Expand Down Expand Up @@ -258,7 +258,7 @@ def _handle_keyboard_interrupt(self):
self.info("Received a keyboard interrupt. Exiting...")
self.info("Press Ctrl+C one more time to kill immediately.")
self.message_router.message_pipe.put_nowait(
Application.Stop(content=None)
AsyncApplication.Stop(content=None)
)
else:
raise e
Expand Down
8 changes: 4 additions & 4 deletions src/appstract/script.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from importlib.metadata import entry_points
from typing import Protocol, TypeVar

from .asyncs import Application, MessageProtocol, MessageRouter
from .asyncs import AsyncApplication, MessageProtocol, MessageRouter
from .constructors import (
Factory,
ProviderGroup,
Expand Down Expand Up @@ -80,7 +80,7 @@ async def shout(self) -> AsyncGenerator[MessageProtocol, None]:
yield HelloWorldMessage(msg)
await asyncio.sleep(1)

yield Application.Stop(content=None)
yield AsyncApplication.Stop(content=None)


def run_helloworld():
Expand All @@ -90,7 +90,7 @@ def run_helloworld():
factory = Factory(
log_providers,
ProviderGroup(
SingletonProvider(Application),
SingletonProvider(AsyncApplication),
SingletonProvider(MessageRouter),
Echo,
Narc,
Expand All @@ -99,7 +99,7 @@ def run_helloworld():

with multiple_constant_providers(factory, parameters):
factory[AppLogger].setLevel(arg_name_space.log_level.upper())
app = factory[Application]
app = factory[AsyncApplication]
echo = factory[Echo]
narc = factory[Narc]

Expand Down

0 comments on commit 779cd43

Please sign in to comment.