PostHog / PostHog/posthog-elixir

Add public shutdown/close API

Open
#146 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
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/close API 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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.