feat: add dependency shutdown and configurable service endpoints

This commit is contained in:
2026-09-24 18:33:24 +08:00
parent 8a348951eb
commit f0991d3ff2
51 changed files with 1433 additions and 73 deletions

View File

@@ -71,9 +71,10 @@ type countedReader struct{ io.Reader }
func (c *countedReader) Close() error { svc.DownloadClosed.Add(1); return nil }
func (l *Logic) Slow(context.Context) (*types.Receipt, error) {
before := svc.Closed.Load()
svc.Started <- struct{}{}
<-svc.Release
if svc.Closed.Load() != 0 {
if svc.Closed.Load() != before {
return nil, errors.New("dependency closed before drain")
}
return &types.Receipt{Bytes: 1}, nil