feat(01-02): dispatch typed events with request context

- App-owned festival bus with Fire, Collect and UntilHandled
- Recover listener panics with owner plugin IDs; isolate buses per app
- towel context accessors and hello command demo of all three modes
This commit is contained in:
Jakub Zych
2026-09-16 13:30:46 +02:00
parent 36c152f4bb
commit a654e96d66
5 changed files with 272 additions and 13 deletions

View File

@@ -5,12 +5,14 @@ import (
"sync"
"git.golem15.com/golem15/summercms/compass"
"git.golem15.com/golem15/summercms/festival"
)
// App is the per-instance application container. It must not import party.
type App struct {
Config *compass.Config
Services *Registry
Events *festival.Bus
mu sync.RWMutex
plugins map[string]struct{}
@@ -21,6 +23,7 @@ func New(cfg *compass.Config) *App {
return &App{
Config: cfg,
Services: NewRegistry(),
Events: festival.New(),
plugins: make(map[string]struct{}),
}
}