Skip to content

Commit

Permalink
refactor: apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: antazoey <[email protected]>
  • Loading branch information
fubuloubu and antazoey authored Sep 20, 2023
1 parent 7bfccb2 commit 1f74a1b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
12 changes: 6 additions & 6 deletions silverback/application.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class SilverbackApp(ManagerAccessMixin):
"""
The application singleton. Must be initialized prior to use.
Usages example::
Usage example::
from silverback import SilverbackApp
Expand All @@ -32,7 +32,7 @@ def __init__(self, settings: Optional[Settings] = None):
Create app
Args:
settings (Optional[silverback.settings:Settings]): Settings override.
settings (Optional[~:class:`silverback.settings.Settings`]): Settings override.
Defaults to environment settings.
"""
if not settings:
Expand Down Expand Up @@ -77,7 +77,7 @@ def on_startup(self) -> Callable:
"""
Code to execute on worker startup / restart after an error.
Usages example::
Usage example::
@app.on_startup()
def do_something_on_startup(state):
Expand All @@ -89,7 +89,7 @@ def on_shutdown(self) -> Callable:
"""
Code to execute on normal worker shutdown.
Usages example::
Usage example::
@app.on_shutdown()
def do_something_on_shutdown(state):
Expand All @@ -114,7 +114,7 @@ def get_event_handler(
Args:
event_target (AddressType): The contract address of the target.
event_name: (str): The name of the event emitted by `event_target`.
event_name: (str): The name of the event emitted by ``event_target``.
Returns:
Optional[AsyncTaskiqDecoratedTask]: Returns decorated task, if one has been created.
Expand All @@ -138,7 +138,7 @@ def on_(
Defaults to whatever the latest block is.
Raises:
InvalidContainerType: If the type of `container` is not configurable for the app.
:class:`~silverback.exceptions.InvalidContainerType`: If the type of `container` is not configurable for the app.
"""
if isinstance(container, BlockContainer):
if self.get_block_handler():
Expand Down
4 changes: 2 additions & 2 deletions silverback/runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,13 @@ async def _event_task(

async def run(self):
"""
Run the task broker client for the assembled `SilverbackApp` application.
Run the task broker client for the assembled ``SilverbackApp`` application.
Will listen for events against the connected provider (using `ManagerAccessMixin` context),
and process them by kicking events over to the configured broker.
Raises:
SilverbackException: If there are no configured tasks to execute.
:class:`~silverback.exceptions.SilverbackException`: If there are no configured tasks to execute.
"""
await self.app.broker.startup()

Expand Down

0 comments on commit 1f74a1b

Please sign in to comment.