Skip to content

Commit

Permalink
Use snake case for message generator
Browse files Browse the repository at this point in the history
  • Loading branch information
MaPePeR committed May 30, 2023
1 parent ac458e0 commit 0dd4f27
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
Expand Up @@ -5,7 +5,7 @@
from aiormq.exceptions import DeliveryError


def getMessagesToPublish():
def get_messages_to_publish():
for i in range(10000):
yield f"Hello World {i}!".encode()

Expand Down Expand Up @@ -38,7 +38,7 @@ async def main() -> None:

async with asyncio.TaskGroup() as tg:
# Sending the messages
for msg in getMessagesToPublish():
for msg in get_messages_to_publish():
tg.create_task(
channel.default_exchange.publish(
Message(msg),
Expand Down
Expand Up @@ -3,7 +3,7 @@
from aio_pika import Message, connect


def getMessagesToPublish():
def get_messages_to_publish():
for i in range(10000):
yield f"Hello World {i}!".encode()

Expand All @@ -23,7 +23,7 @@ async def main() -> None:
outstanding_messages = []

# Sending the messages
for msg in getMessagesToPublish():
for msg in get_messages_to_publish():
outstanding_messages.append(
channel.default_exchange.publish(
Message(msg),
Expand Down
Expand Up @@ -3,7 +3,7 @@
from aio_pika import Message, connect


def getMessagesToPublish():
def get_messages_to_publish():
for i in range(10000):
yield f"Hello World {i}!".encode()

Expand All @@ -20,7 +20,7 @@ async def main() -> None:
queue = await channel.declare_queue("hello")

# Sending the messages
for msg in getMessagesToPublish():
for msg in get_messages_to_publish():
# Waiting for publisher confirmation with timeout for every message
await channel.default_exchange.publish(
Message(msg),
Expand Down

0 comments on commit 0dd4f27

Please sign in to comment.