Skip to content

Commit 779cd43

Browse files
committed
Update asynchornous application class name
1 parent 05ac23d commit 779cd43

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

src/appstract/asyncs.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -151,8 +151,8 @@ async def send_message_async(self, message: MessageProtocol) -> None:
151151
await asyncio.sleep(0)
152152

153153

154-
class Application(LogMixin):
155-
"""Application class.
154+
class AsyncApplication(LogMixin):
155+
"""Asynchronous Application class.
156156
157157
Main Responsibilities:
158158
- Create/retrieve event loop if needed.
@@ -258,7 +258,7 @@ def _handle_keyboard_interrupt(self):
258258
self.info("Received a keyboard interrupt. Exiting...")
259259
self.info("Press Ctrl+C one more time to kill immediately.")
260260
self.message_router.message_pipe.put_nowait(
261-
Application.Stop(content=None)
261+
AsyncApplication.Stop(content=None)
262262
)
263263
else:
264264
raise e

src/appstract/script.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
from importlib.metadata import entry_points
88
from typing import Protocol, TypeVar
99

10-
from .asyncs import Application, MessageProtocol, MessageRouter
10+
from .asyncs import AsyncApplication, MessageProtocol, MessageRouter
1111
from .constructors import (
1212
Factory,
1313
ProviderGroup,
@@ -80,7 +80,7 @@ async def shout(self) -> AsyncGenerator[MessageProtocol, None]:
8080
yield HelloWorldMessage(msg)
8181
await asyncio.sleep(1)
8282

83-
yield Application.Stop(content=None)
83+
yield AsyncApplication.Stop(content=None)
8484

8585

8686
def run_helloworld():
@@ -90,7 +90,7 @@ def run_helloworld():
9090
factory = Factory(
9191
log_providers,
9292
ProviderGroup(
93-
SingletonProvider(Application),
93+
SingletonProvider(AsyncApplication),
9494
SingletonProvider(MessageRouter),
9595
Echo,
9696
Narc,
@@ -99,7 +99,7 @@ def run_helloworld():
9999

100100
with multiple_constant_providers(factory, parameters):
101101
factory[AppLogger].setLevel(arg_name_space.log_level.upper())
102-
app = factory[Application]
102+
app = factory[AsyncApplication]
103103
echo = factory[Echo]
104104
narc = factory[Narc]
105105

0 commit comments

Comments
 (0)