Unverified Commit 90dcfbba authored by Dan Jones's avatar Dan Jones
Browse files

feat: prototype soar backbone implementation

Quick sketch of what soar might look like.
#!/usr/bin/env python
import pika
def get_connection():
return pika.BlockingConnection(pika.ConnectionParameters(host="localhost"))
def subscribe(
queue_name,
topic,
publish_exchange="soar_publish",
broadcast_exchange="soar_broadcast",
):
adm_connection = get_connection()
admin_channel = adm_connection.channel()
admin_channel.exchange_declare(exchange=broadcast_exchange, exchange_type="fanout")
admin_channel.queue_bind(exchange=broadcast_exchange, queue=queue_name)
sub_connection = get_connection()
subscriber_channel = sub_connection.channel()
subscriber_channel.exchange_declare(
exchange=publish_exchange, exchange_type="topic"
)
subscriber_channel.queue_bind(
exchange=publish_exchange, queue=queue_name, routing_key=topic
)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment