Skip to content
_CORE
AI & Agentic Systems Core Information Systems Cloud & Platform Engineering Data Platform & Integration Security & Compliance QA, Testing & Observability IoT, Automation & Robotics Mobile & Digital Banking & Finance Insurance Public Administration Defense & Security Healthcare Energy & Utilities Telco & Media Manufacturing Logistics & E-commerce Retail & Loyalty
References Technologies Blog Know-how Tools
About Collaboration Careers
CS EN DE
Let's talk

Event-Driven Programming

06. 11. 2025 Updated: 24. 03. 2026 1 min read intermediate

Event-driven architecture decouples producers and consumers. Loosely coupled, scalable, resilient systems.

Publish/Subscribe Pattern

Event-Driven Programming

class EventBus: def __init__(self): self.handlers = {} def subscribe(self, event_type, handler): self.handlers.setdefault(event_type, []).append(handler) def publish(self, event_type, data): for handler in self.handlers.get(event_type, []): handler(data) bus = EventBus() bus.subscribe(‘user.created’, send_welcome_email) bus.subscribe(‘user.created’, create_default_settings) bus.publish(‘user.created’, {‘id’: 1, ‘email’: ‘[email protected]’})

Kafka

Producer

from kafka import KafkaProducer producer = KafkaProducer(bootstrap_servers=’localhost:9092’) producer.send(‘events’, json.dumps({‘type’: ‘order.created’, ‘data’: {…}}).encode())

Consumer

from kafka import KafkaConsumer consumer = KafkaConsumer(‘events’, bootstrap_servers=’localhost:9092’) for message in consumer: event = json.loads(message.value) handle_event(event)

Key Takeaway

Events for loosely coupled systems. Kafka for high-throughput, RabbitMQ for complex routing.

event-drivenarchitecturekafkarabbitmq
Share:

CORE SYSTEMS team

We build core systems and AI agents that keep operations running. 15 years of experience with enterprise IT.