(new): expand runtime APIs
Golang lint / lint (push) Successful in 58s
Golang lint / lint (pull_request) Successful in 13m10s

(fix): harden concurrent lifecycle
(tests): add regression coverage
(doc): update v1.2 guidance
This commit is contained in:
2026-08-20 11:08:45 +03:00
parent 29b208eeec
commit 24040fe164
37 changed files with 1129 additions and 157 deletions
+2 -1
View File
@@ -228,7 +228,8 @@ func (ErrorEvent) isEvent() {}
// During RunWithContext and RunWebhookWithContext, callbacks execute on a
// dedicated dispatcher goroutine in enqueue order and never block update
// handlers. The queue is bounded; overload drops events and emits sampled
// warnings. Runtime shutdown drains events that were already queued.
// warnings. Runtime shutdown cancels callback contexts and drains queued events;
// Bot.Close returns ErrObserverShutdownTimeout if a callback ignores cancellation.
type Observer interface {
OnUpdateReceived(ctx context.Context, event UpdateReceivedEvent)
OnUpdateHandled(ctx context.Context, event UpdateHandledEvent)