v0.0.8
UnreleasedShutting a Server down properly, and the last piece a custom server needed.
Added
Server.Close(ctx)stops accepting batches, waits for the deliveries already in flight and then closes every flusher that implementsCloser. AServeranswers a POST before it delivers, sohttp.Server.Shutdownreturning told you nothing about whether the events arrived, and a flusher holding a resource, aSQLpool for instance, was never closed at all. Whenctxends first it returnsctx.Err()and leaves the deliveries running, without closing the flushers: closing one underneath a delivery is worse than leaking it. It is idempotent, and afterwards a POST is refused with 503 andUNAVAILABLEwhile GET still answersOK, so a health check can watch the drain.SortEvents(evts), the orderProducerandServerput a batch in before handing it to the flushers. A program that runs its own server needs it to satisfyFlushAll's contract, and was reimplementing it.