diff --git a/tasks/ostrovskaya-sf/lab_4/README.md b/tasks/ostrovskaya-sf/lab_4/README.md
new file mode 100644
index 0000000..16f3aab
--- /dev/null
+++ b/tasks/ostrovskaya-sf/lab_4/README.md
@@ -0,0 +1,115 @@
+# Отчет по лабораторной работе №4
+
+Выполнила студентка гр. ИСЭбд-41 Островская С. Ф.
+
+## Прохождение tutorial
+
+Установила rabbitMQ server, erlang и зашла в брокер под гостем по http://localhost:15672/#/
+![](pic/pic1.jpg)
+
+Туториал 1:
+
+![](pic/pic2.jpg)
+![](pic/pic3.jpg)
+
+Туториал 2:
+
+![](pic/pic4.jpg)
+![](pic/pic5.jpg)
+
+Туториал 3:
+
+![](pic/pic6.jpg)
+![](pic/pic7.jpg)
+
+## Разработка демонстрационных приложений
+
+Предметная область: Дополнительный соглашения и договоры на проживание.
+Разработаны три приложения, согласно предметной области.
+
+1. Publisher
+
+```py
+import pika
+import time
+import random
+
+collection = ["Application for accommodation in a dormitory", "Rector's order", "Conclusion of an agreement", "Check-into a dormitory"]
+
+connection = pika.BlockingConnection(pika.ConnectionParameters('localhost'))
+channel = connection.channel()
+
+channel.exchange_declare(exchange='Agreements', exchange_type='fanout')
+
+while True:
+ message = f"Message: {random.choice(collection)}"
+
+ channel.basic_publish(exchange='Agreements', routing_key='', body=message)
+
+ time.sleep(1)
+
+connection.close()
+```
+
+2. Consumer 1.
+
+```py
+import pika
+import time
+
+def process_message(ch, method, properties, body):
+ print(f"Получено сообщение: {body}")
+ time.sleep(3)
+ print("Сообщение успешно обработано")
+
+connection = pika.BlockingConnection(pika.ConnectionParameters('localhost'))
+channel = connection.channel()
+
+result = channel.queue_declare(queue='', exclusive=True)
+queue_name = result.method.queue
+
+channel.queue_bind(exchange='Agreements', queue=queue_name)
+
+channel.basic_consume(queue=queue_name, on_message_callback=process_message, auto_ack=True)
+
+print('Ожидание сообщений...')
+channel.start_consuming()
+```
+
+3. Consumer 2.
+
+```py
+import pika
+
+
+def process_message(ch, method, properties, body):
+ print(f"Получено сообщение: {body}")
+ print("Сообщение успешно обработано")
+
+connection = pika.BlockingConnection(pika.ConnectionParameters('localhost'))
+channel = connection.channel()
+
+result = channel.queue_declare(queue='', exclusive=True)
+queue_name = result.method.queue
+
+channel.queue_bind(exchange='Agreements', queue=queue_name)
+
+channel.basic_consume(queue=queue_name, on_message_callback=process_message, auto_ack=True)
+
+print('Ожидание сообщений...')
+channel.start_consuming()
+```
+
+## Результаты выполнения лабораторной работы
+
+Результат отработки Consumer_1:
+
+![](pic/pic8.jpg)
+![](pic/pic9.jpg)
+
+Результат отработки Consumer_2:
+
+![](pic/pic10.jpg)
+![](pic/pic11.jpg)
+
+Вывод: Consumer_2 нагружает меньше памяти, чем Consumer_1 и принимает сообщения гораздо быстрее, тем самым не позволяя очереди накапливать огромное количество сообщений.
\ No newline at end of file
diff --git a/tasks/ostrovskaya-sf/lab_4/lab_4_py/.idea/.gitignore b/tasks/ostrovskaya-sf/lab_4/lab_4_py/.idea/.gitignore
new file mode 100644
index 0000000..26d3352
--- /dev/null
+++ b/tasks/ostrovskaya-sf/lab_4/lab_4_py/.idea/.gitignore
@@ -0,0 +1,3 @@
+# Default ignored files
+/shelf/
+/workspace.xml
diff --git a/tasks/ostrovskaya-sf/lab_4/lab_4_py/.idea/inspectionProfiles/profiles_settings.xml b/tasks/ostrovskaya-sf/lab_4/lab_4_py/.idea/inspectionProfiles/profiles_settings.xml
new file mode 100644
index 0000000..105ce2d
--- /dev/null
+++ b/tasks/ostrovskaya-sf/lab_4/lab_4_py/.idea/inspectionProfiles/profiles_settings.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/tasks/ostrovskaya-sf/lab_4/lab_4_py/.idea/lab_4_py.iml b/tasks/ostrovskaya-sf/lab_4/lab_4_py/.idea/lab_4_py.iml
new file mode 100644
index 0000000..d0876a7
--- /dev/null
+++ b/tasks/ostrovskaya-sf/lab_4/lab_4_py/.idea/lab_4_py.iml
@@ -0,0 +1,8 @@
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/tasks/ostrovskaya-sf/lab_4/lab_4_py/.idea/misc.xml b/tasks/ostrovskaya-sf/lab_4/lab_4_py/.idea/misc.xml
new file mode 100644
index 0000000..d56657a
--- /dev/null
+++ b/tasks/ostrovskaya-sf/lab_4/lab_4_py/.idea/misc.xml
@@ -0,0 +1,4 @@
+
+
+
+
\ No newline at end of file
diff --git a/tasks/ostrovskaya-sf/lab_4/lab_4_py/.idea/modules.xml b/tasks/ostrovskaya-sf/lab_4/lab_4_py/.idea/modules.xml
new file mode 100644
index 0000000..995468a
--- /dev/null
+++ b/tasks/ostrovskaya-sf/lab_4/lab_4_py/.idea/modules.xml
@@ -0,0 +1,8 @@
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/tasks/ostrovskaya-sf/lab_4/lab_4_py/main_task/consumer_1.py b/tasks/ostrovskaya-sf/lab_4/lab_4_py/main_task/consumer_1.py
new file mode 100644
index 0000000..ba5e8c8
--- /dev/null
+++ b/tasks/ostrovskaya-sf/lab_4/lab_4_py/main_task/consumer_1.py
@@ -0,0 +1,20 @@
+import pika
+import time
+
+def process_message(ch, method, properties, body):
+ print(f"Получено сообщение: {body}")
+ time.sleep(3)
+ print("Сообщение успешно обработано")
+
+connection = pika.BlockingConnection(pika.ConnectionParameters('localhost'))
+channel = connection.channel()
+
+result = channel.queue_declare(queue='', exclusive=True)
+queue_name = result.method.queue
+
+channel.queue_bind(exchange='Agreements', queue=queue_name)
+
+channel.basic_consume(queue=queue_name, on_message_callback=process_message, auto_ack=True)
+
+print('Ожидание сообщений...')
+channel.start_consuming()
\ No newline at end of file
diff --git a/tasks/ostrovskaya-sf/lab_4/lab_4_py/main_task/consumer_2.py b/tasks/ostrovskaya-sf/lab_4/lab_4_py/main_task/consumer_2.py
new file mode 100644
index 0000000..cc24bb1
--- /dev/null
+++ b/tasks/ostrovskaya-sf/lab_4/lab_4_py/main_task/consumer_2.py
@@ -0,0 +1,19 @@
+import pika
+
+
+def process_message(ch, method, properties, body):
+ print(f"Получено сообщение: {body}")
+ print("Сообщение успешно обработано")
+
+connection = pika.BlockingConnection(pika.ConnectionParameters('localhost'))
+channel = connection.channel()
+
+result = channel.queue_declare(queue='', exclusive=True)
+queue_name = result.method.queue
+
+channel.queue_bind(exchange='Agreements', queue=queue_name)
+
+channel.basic_consume(queue=queue_name, on_message_callback=process_message, auto_ack=True)
+
+print('Ожидание сообщений...')
+channel.start_consuming()
\ No newline at end of file
diff --git a/tasks/ostrovskaya-sf/lab_4/lab_4_py/main_task/publisher.py b/tasks/ostrovskaya-sf/lab_4/lab_4_py/main_task/publisher.py
new file mode 100644
index 0000000..7facc09
--- /dev/null
+++ b/tasks/ostrovskaya-sf/lab_4/lab_4_py/main_task/publisher.py
@@ -0,0 +1,19 @@
+import pika
+import time
+import random
+
+collection = ["Application for accommodation in a dormitory", "Rector's order", "Conclusion of an agreement", "Check-into a dormitory"]
+
+connection = pika.BlockingConnection(pika.ConnectionParameters('localhost'))
+channel = connection.channel()
+
+channel.exchange_declare(exchange='Agreements', exchange_type='fanout')
+
+while True:
+ message = f"Message: {random.choice(collection)}"
+
+ channel.basic_publish(exchange='Agreements', routing_key='', body=message)
+
+ time.sleep(1)
+
+connection.close()
\ No newline at end of file
diff --git a/tasks/ostrovskaya-sf/lab_4/lab_4_py/tutorial_1/receive.py b/tasks/ostrovskaya-sf/lab_4/lab_4_py/tutorial_1/receive.py
new file mode 100644
index 0000000..f62e428
--- /dev/null
+++ b/tasks/ostrovskaya-sf/lab_4/lab_4_py/tutorial_1/receive.py
@@ -0,0 +1,25 @@
+import pika, sys, os
+
+def main():
+ connection = pika.BlockingConnection(pika.ConnectionParameters(host='localhost'))
+ channel = connection.channel()
+
+ channel.queue_declare(queue='OstrovsofaLogs')
+
+ def callback(ch, method, properties, body):
+ print(f" [x] Получено сообщение: {body}")
+
+ channel.basic_consume(queue='OstrovsofaLogs', on_message_callback=callback, auto_ack=True)
+
+ print(' [*] Ожидание сообщений. Для завершения CTRL+C')
+ channel.start_consuming()
+
+if __name__ == '__main__':
+ try:
+ main()
+ except KeyboardInterrupt:
+ print('Произошла ошибка')
+ try:
+ sys.exit(0)
+ except SystemExit:
+ os._exit(0)
\ No newline at end of file
diff --git a/tasks/ostrovskaya-sf/lab_4/lab_4_py/tutorial_1/send.py b/tasks/ostrovskaya-sf/lab_4/lab_4_py/tutorial_1/send.py
new file mode 100644
index 0000000..0b605e6
--- /dev/null
+++ b/tasks/ostrovskaya-sf/lab_4/lab_4_py/tutorial_1/send.py
@@ -0,0 +1,11 @@
+import pika
+
+connection = pika.BlockingConnection(pika.ConnectionParameters('localhost'))
+channel = connection.channel()
+
+channel.queue_declare(queue='ostrovsofa')
+
+channel.basic_publish(exchange='',routing_key='ostrovsofa',body='My cat"s name is Montik!')
+print(" [x] Отправлено сообщение")
+
+connection.close()
\ No newline at end of file
diff --git a/tasks/ostrovskaya-sf/lab_4/lab_4_py/tutorial_2/new_task.py b/tasks/ostrovskaya-sf/lab_4/lab_4_py/tutorial_2/new_task.py
new file mode 100644
index 0000000..9481bbc
--- /dev/null
+++ b/tasks/ostrovskaya-sf/lab_4/lab_4_py/tutorial_2/new_task.py
@@ -0,0 +1,13 @@
+import pika
+import sys
+
+connection = pika.BlockingConnection(pika.ConnectionParameters(host='localhost'))
+channel = connection.channel()
+
+channel.queue_declare(queue='ostrovsofa2', durable=True)
+
+message = ' '.join(sys.argv[1:]) or "My cat's name is Montik!"
+channel.basic_publish(exchange='', routing_key='ostrovsofa2', body=message, properties=pika.BasicProperties(
+ delivery_mode=pika.spec.PERSISTENT_DELIVERY_MODE))
+print(f" [x] Отправлено {message}")
+connection.close()
\ No newline at end of file
diff --git a/tasks/ostrovskaya-sf/lab_4/lab_4_py/tutorial_2/worker.py b/tasks/ostrovskaya-sf/lab_4/lab_4_py/tutorial_2/worker.py
new file mode 100644
index 0000000..4eb8ba9
--- /dev/null
+++ b/tasks/ostrovskaya-sf/lab_4/lab_4_py/tutorial_2/worker.py
@@ -0,0 +1,19 @@
+import pika
+import time
+
+connection = pika.BlockingConnection(pika.ConnectionParameters(host='localhost'))
+channel = connection.channel()
+
+channel.queue_declare(queue='ostrovsofa2', durable=True)
+print(' [*] Ожидание сообщений. Для завершения CTRL+C')
+
+def callback(ch, method, properties, body):
+ print(f" [x] Получено сообщение: {body.decode()}")
+ time.sleep(body.count(b'.'))
+ print(" [x] Выполнено")
+ ch.basic_ack(delivery_tag=method.delivery_tag)
+
+channel.basic_qos(prefetch_count=1)
+channel.basic_consume(queue='ostrovsofa2', on_message_callback=callback)
+
+channel.start_consuming()
\ No newline at end of file
diff --git a/tasks/ostrovskaya-sf/lab_4/lab_4_py/tutorial_3/emit_log.py b/tasks/ostrovskaya-sf/lab_4/lab_4_py/tutorial_3/emit_log.py
new file mode 100644
index 0000000..318f38f
--- /dev/null
+++ b/tasks/ostrovskaya-sf/lab_4/lab_4_py/tutorial_3/emit_log.py
@@ -0,0 +1,12 @@
+import pika
+import sys
+
+connection = pika.BlockingConnection(pika.ConnectionParameters(host='localhost'))
+channel = connection.channel()
+
+channel.exchange_declare(exchange='OstrovsofaLogs', exchange_type='fanout')
+
+message = ' '.join(sys.argv[1:]) or "Info: My cat's name is Montik!"
+channel.basic_publish(exchange='OstrovsofaLogs', routing_key='', body=message)
+print(f" [x] Отправлено сообщение: {message}")
+connection.close()
\ No newline at end of file
diff --git a/tasks/ostrovskaya-sf/lab_4/lab_4_py/tutorial_3/receive_logs.py b/tasks/ostrovskaya-sf/lab_4/lab_4_py/tutorial_3/receive_logs.py
new file mode 100644
index 0000000..230b0de
--- /dev/null
+++ b/tasks/ostrovskaya-sf/lab_4/lab_4_py/tutorial_3/receive_logs.py
@@ -0,0 +1,21 @@
+import pika
+
+connection = pika.BlockingConnection(pika.ConnectionParameters(host='localhost'))
+channel = connection.channel()
+
+channel.exchange_declare(exchange='OstrovsofaLogs', exchange_type='fanout')
+
+result = channel.queue_declare(queue='', exclusive=True)
+queue_name = result.method.queue
+
+channel.queue_bind(exchange='OstrovsofaLogs', queue=queue_name)
+
+print(' [*] Ожидание сообщений. Для завершения CTRL+C')
+
+def callback(ch, method, properties, body):
+ print(f" [x] {body}")
+
+channel.basic_consume(
+ queue=queue_name, on_message_callback=callback, auto_ack=True)
+
+channel.start_consuming()
\ No newline at end of file
diff --git a/tasks/ostrovskaya-sf/lab_4/pic/pic1.jpg b/tasks/ostrovskaya-sf/lab_4/pic/pic1.jpg
new file mode 100644
index 0000000..96332f0
Binary files /dev/null and b/tasks/ostrovskaya-sf/lab_4/pic/pic1.jpg differ
diff --git a/tasks/ostrovskaya-sf/lab_4/pic/pic10.jpg b/tasks/ostrovskaya-sf/lab_4/pic/pic10.jpg
new file mode 100644
index 0000000..b9c7732
Binary files /dev/null and b/tasks/ostrovskaya-sf/lab_4/pic/pic10.jpg differ
diff --git a/tasks/ostrovskaya-sf/lab_4/pic/pic11.jpg b/tasks/ostrovskaya-sf/lab_4/pic/pic11.jpg
new file mode 100644
index 0000000..c59d6ca
Binary files /dev/null and b/tasks/ostrovskaya-sf/lab_4/pic/pic11.jpg differ
diff --git a/tasks/ostrovskaya-sf/lab_4/pic/pic2.jpg b/tasks/ostrovskaya-sf/lab_4/pic/pic2.jpg
new file mode 100644
index 0000000..95e899b
Binary files /dev/null and b/tasks/ostrovskaya-sf/lab_4/pic/pic2.jpg differ
diff --git a/tasks/ostrovskaya-sf/lab_4/pic/pic3.jpg b/tasks/ostrovskaya-sf/lab_4/pic/pic3.jpg
new file mode 100644
index 0000000..a19b365
Binary files /dev/null and b/tasks/ostrovskaya-sf/lab_4/pic/pic3.jpg differ
diff --git a/tasks/ostrovskaya-sf/lab_4/pic/pic4.jpg b/tasks/ostrovskaya-sf/lab_4/pic/pic4.jpg
new file mode 100644
index 0000000..1098000
Binary files /dev/null and b/tasks/ostrovskaya-sf/lab_4/pic/pic4.jpg differ
diff --git a/tasks/ostrovskaya-sf/lab_4/pic/pic5.jpg b/tasks/ostrovskaya-sf/lab_4/pic/pic5.jpg
new file mode 100644
index 0000000..a89845a
Binary files /dev/null and b/tasks/ostrovskaya-sf/lab_4/pic/pic5.jpg differ
diff --git a/tasks/ostrovskaya-sf/lab_4/pic/pic6.jpg b/tasks/ostrovskaya-sf/lab_4/pic/pic6.jpg
new file mode 100644
index 0000000..78e4fe0
Binary files /dev/null and b/tasks/ostrovskaya-sf/lab_4/pic/pic6.jpg differ
diff --git a/tasks/ostrovskaya-sf/lab_4/pic/pic7.jpg b/tasks/ostrovskaya-sf/lab_4/pic/pic7.jpg
new file mode 100644
index 0000000..d7583fc
Binary files /dev/null and b/tasks/ostrovskaya-sf/lab_4/pic/pic7.jpg differ
diff --git a/tasks/ostrovskaya-sf/lab_4/pic/pic8.jpg b/tasks/ostrovskaya-sf/lab_4/pic/pic8.jpg
new file mode 100644
index 0000000..ff0fd92
Binary files /dev/null and b/tasks/ostrovskaya-sf/lab_4/pic/pic8.jpg differ
diff --git a/tasks/ostrovskaya-sf/lab_4/pic/pic9.jpg b/tasks/ostrovskaya-sf/lab_4/pic/pic9.jpg
new file mode 100644
index 0000000..0ccfbac
Binary files /dev/null and b/tasks/ostrovskaya-sf/lab_4/pic/pic9.jpg differ