feat: add working application and synthetic sample data
GBB Demo authored on Nov 2, 2026
commit 7747814fd89f
Root commit: changes are relative to an empty tree.
4 files changed, +39 −0
- .gitignore+3 −0@@ -1,0 +1,3 @@1+__pycache__/2+node_modules/3+.env
- README.md+5 −0@@ -1,0 +1,5 @@1+# Event Router2+3+A small event dispatcher with explicit routing and isolated subscriber failures.4+5+Synthetic evaluation project.
- app.py+16 −0@@ -1,0 +1,16 @@1+class Router:2+ def __init__(self):3+ self.handlers = {}4+5+ def subscribe(self, event_type, handler):6+ self.handlers.setdefault(event_type, []).append(handler)7+8+ def publish(self, event):9+ outcomes = []10+ for handler in tuple(self.handlers.get(event["type"], [])):11+ try:12+ outcomes.append({"ok": True, "result": handler(event["payload"])})13+ except Exception as error:14+ outcomes.append({"ok": False, "error": type(error).__name__})15+ return outcomes16+
- data/sample.json+15 −0@@ -1,0 +1,15 @@1+{2+ "environment": "demo",3+ "items": [4+ {5+ "id": "sample-1",6+ "name": "Explore the source",7+ "done": true8+ },9+ {10+ "id": "sample-2",11+ "name": "Review the draft PR",12+ "done": false13+ }14+ ]15+}