strvcom / strv-backend-go-background

Never lose your goroutine again.

Home Page:https://go.strv.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

feat: option to report or kill stalled goroutines

robertrossmann opened this issue · comments

Currently when a goroutine runs indefinitely this package does not really care. Perhaps it would be good to add a configuration option, MaxDuration, which when set, would trigger a hook (.OnMaxDurationExceeded(ctx context.Context, meta Meta)).

Optionally, we could try to come up with some mechanism to allow the hook to also kill the goroutine.

Implemented in #2 . No goroutine killing after exceeding the threshold for now, just reporting.