WIP: streamer Start takes a ctx; README and TODO
check / check (push) Canceled after 0s

Model: opus-5-5
This commit is contained in:
2026-10-14 13:04:16 +00:00
parent 50c8e9d276
commit 465e3ea292
5 changed files with 27 additions and 15 deletions
+1 -1
View File
@@ -109,7 +109,7 @@ func (rw *RouteWatch) Run(ctx context.Context) error {
// No longer need routing table handler - PrefixHandler maintains live_routes table
// Start streaming
err := rw.streamer.Start()
err := rw.streamer.Start(ctx)
if err != nil {
return err
}
+4 -3
View File
@@ -188,8 +188,9 @@ func (s *Streamer) RegisterRawHandler(handler RawMessageHandler) {
// Start begins streaming BGP updates from the RIS Live API in a background goroutine.
// It starts worker goroutines for each registered handler and manages automatic
// reconnection with exponential backoff on connection failures.
// Returns an error if the streamer is already running.
func (s *Streamer) Start() error {
// Returns an error if the streamer is already running. It streams until Stop:
// the end of ctx does not stop it.
func (s *Streamer) Start(ctx context.Context) error {
s.mu.Lock()
defer s.mu.Unlock()
@@ -197,7 +198,7 @@ func (s *Streamer) Start() error {
return errAlreadyRunning
}
ctx, cancel := context.WithCancel(context.Background())
ctx, cancel := context.WithCancel(context.WithoutCancel(ctx))
s.cancel = cancel
s.running = true