From faf6ed310bd1c9c27abda1789228fd1d188512c1 Mon Sep 17 00:00:00 2001 From: Damien Garros Date: Thu, 15 Dec 2022 17:57:20 +0100 Subject: [PATCH] Replace aiormq.types with aiormq.abc in all examples --- README.rst | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/README.rst b/README.rst index ed73e53..693e989 100644 --- a/README.rst +++ b/README.rst @@ -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}") @@ -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( @@ -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 @@ -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 @@ -564,7 +564,7 @@ RPC server import asyncio import aiormq - import aiormq.types + import aiormq.abc def fib(n): @@ -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})") @@ -625,7 +625,7 @@ RPC client import asyncio import uuid import aiormq - import aiormq.types + import aiormq.abc class FibonacciRpcClient: @@ -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)