Skip to content

Add public shutdown/close API #146

Description

@marandaneto

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: PostHog/posthog-python#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

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions