main #3
@ -2,7 +2,7 @@ import pika
|
|||||||
import time
|
import time
|
||||||
import random
|
import random
|
||||||
|
|
||||||
collection = ["Application for general business expenses", "The contract is completed", "Enrollment order completed", "Student enrolled"]
|
collection = ["the employment document", "The document is agreed", "Signatures are provided", "the employee is accepted"]
|
||||||
|
|
||||||
connection = pika.BlockingConnection(pika.ConnectionParameters('localhost'))
|
connection = pika.BlockingConnection(pika.ConnectionParameters('localhost'))
|
||||||
channel = connection.channel()
|
channel = connection.channel()
|
||||||
|
@ -37,7 +37,7 @@ import pika
|
|||||||
import time
|
import time
|
||||||
import random
|
import random
|
||||||
|
|
||||||
collection = ["Application for accommodation in a dormitory", "Rector's order", "Conclusion of an agreement", "Check-into a dormitory"]
|
collection = ["the employment document", "The document is agreed", "Signatures are provided", "the employee is accepted"]
|
||||||
|
|
||||||
connection = pika.BlockingConnection(pika.ConnectionParameters('localhost'))
|
connection = pika.BlockingConnection(pika.ConnectionParameters('localhost'))
|
||||||
channel = connection.channel()
|
channel = connection.channel()
|
||||||
@ -107,12 +107,12 @@ channel.start_consuming()
|
|||||||
|
|
||||||
Результат отработки Consumer_1:
|
Результат отработки Consumer_1:
|
||||||
|
|
||||||

|

|
||||||

|

|
||||||
|
|
||||||
Результат отработки Consumer_2:
|
Результат отработки Consumer_2:
|
||||||
|
|
||||||

|

|
||||||

|

|
||||||
|
|
||||||
Вывод: Consumer_2 нагружает меньше памяти, чем Consumer_1 и принимает сообщения гораздо быстрее, тем самым не позволяя очереди накапливать огромное количество сообщений.
|
Вывод: Consumer_2 нагружает меньше памяти, чем Consumer_1 и принимает сообщения гораздо быстрее, тем самым не позволяя очереди накапливать огромное количество сообщений.
|
BIN
tasks/zinoveva-ad/lab_4/pic/Screenshot_16.jpg
Normal file
BIN
tasks/zinoveva-ad/lab_4/pic/Screenshot_16.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 67 KiB |
BIN
tasks/zinoveva-ad/lab_4/pic/Screenshot_17.jpg
Normal file
BIN
tasks/zinoveva-ad/lab_4/pic/Screenshot_17.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 73 KiB |
Loading…
x
Reference in New Issue
Block a user