PostHog / PostHog/posthog-elixir
Add public shutdown/close API
Nobody has claimed this yet.
- Dominant language
- Elixir
- Stars
- 65
- Forks
- 30
- Avg merge
- 1d 16h
- Merged PRs (30d)
- 16
Description
Summary
Add a public idempotent shutdown/close API.
Why
sdk-specs marks shutdown as applicable to both client and server SDKs. Backend SDKs should provide an explicit end-of-life hook that drains queued events and stops workers/timers.
Current status
The SDK has a supervision tree, but no public SDK-level shutdown/close API. Python has a related issue about bounded flush/shutdown behavior: https://github.com/PostHog/posthog-python/issues/79.
Suggested scope
- Add public
shutdown/closeAPI for the default and named instances. - Stop accepting new events after shutdown or make post-shutdown behavior explicit.
- Attempt a bounded final flush.
- Stop sender workers/timers and any future pollers/cache providers.
- Make repeated calls safe/idempotent.
- Add tests and docs.
References
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reading the existing supervision tree and the sdk-specs shutdown specification linked in the issue. Trace the default and named instances, sender workers, timers, and queued-event handling before deciding where the public API belongs. Done means shutdown/close behavior is documented, repeated calls are safe, final flushing is bounded, workers stop, and tests cover the stated scope.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- elixir
- Domain
- backend
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100