Skip to content

Commit

Permalink
Merge pull request #161 from dgarros/patch-1
Browse files Browse the repository at this point in the history
Replace aiormq.types with aiormq.abc in all examples
  • Loading branch information
mosquito authored Dec 15, 2022
2 parents 5f00918 + faf6ed3 commit bae3c74
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -218,10 +218,10 @@ Simple worker
import asyncio
import aiormq
import aiormq.types
import aiormq.abc
async def on_message(message: aiormq.types.DeliveredMessage):
async def on_message(message: aiormq.abc.DeliveredMessage):
print(f" [x] Received message {message!r}")
print(f" Message body is: {message.body!r}")
Expand Down Expand Up @@ -298,10 +298,10 @@ Subscriber
import asyncio
import aiormq
import aiormq.types
import aiormq.abc
async def on_message(message: aiormq.types.DeliveredMessage):
async def on_message(message: aiormq.abc.DeliveredMessage):
print(f"[x] {message.body!r}")
await message.channel.basic_ack(
Expand Down Expand Up @@ -351,10 +351,10 @@ Direct consumer
import sys
import asyncio
import aiormq
import aiormq.types
import aiormq.abc
async def on_message(message: aiormq.types.DeliveredMessage):
async def on_message(message: aiormq.abc.DeliveredMessage):
print(f" [x] {message.delivery.routing_key!r}:{message.body!r}"
await message.channel.basic_ack(
message.delivery.delivery_tag
Expand Down Expand Up @@ -503,10 +503,10 @@ Consumer
import asyncio
import sys
import aiormq
import aiormq.types
import aiormq.abc
async def on_message(message: aiormq.types.DeliveredMessage):
async def on_message(message: aiormq.abc.DeliveredMessage):
print(f" [x] {message.delivery.routing_key!r}:{message.body!r}")
await message.channel.basic_ack(
message.delivery.delivery_tag
Expand Down Expand Up @@ -564,7 +564,7 @@ RPC server
import asyncio
import aiormq
import aiormq.types
import aiormq.abc
def fib(n):
Expand All @@ -576,7 +576,7 @@ RPC server
return fib(n-1) + fib(n-2)
async def on_message(message:aiormq.types.DeliveredMessage):
async def on_message(message:aiormq.abc.DeliveredMessage):
n = int(message.body.decode())
print(f" [.] fib({n})")
Expand Down Expand Up @@ -625,7 +625,7 @@ RPC client
import asyncio
import uuid
import aiormq
import aiormq.types
import aiormq.abc
class FibonacciRpcClient:
Expand All @@ -650,7 +650,7 @@ RPC client
return self
async def on_response(self, message: aiormq.types.DeliveredMessage):
async def on_response(self, message: aiormq.abc.DeliveredMessage):
future = self.futures.pop(message.header.properties.correlation_id)
future.set_result(message.body)
Expand Down

0 comments on commit bae3c74

Please sign in to comment.