Skip to content
 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

leartech-python-common

Shared Python libraries for leartech services.

leartech_common.bus — event-bus client

Publish/subscribe domain events over a pluggable transport (Redis today; Maestro behind the same interface later). The wire Envelope is byte-identical to leartech-bus-common (Go) — verified cross-language — so Python and Go services interoperate on the same bus.

from leartech_common.bus import Bus, Context, RedisTransport

bus = Bus(RedisTransport("redis://redis:6379/0"), source="orchestrator")
bus.publish(Context(), "initiative.fired", {"run_id": "…"}, topic="leartech.events")
bus.subscribe("leartech.events", lambda ctx, env: print(env.type, env.payload))

tenant_id defaults to "system"; the auth work fills it from the caller's token later without changing any call site. Contract: ~/leartech/Hub/status/event-bus-contract.md.

About

Shared Python libraries for leartech services (bus client, etc.)

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages