Following on from #55 / #57, the analytics thread now flushes buffered counts when its last sender drops, but nothing waits for that flush to finish.
We can fix that, however, we need to make design decisions around AnalyticsProcessor lifecycle to find the best place to block at. Right now, AnalyticsProcessor clones owned by Flags can outlive Flagsmith, which is arguably wrong.
Options
- Add explicit
shutdown() on Flagsmith that closes the channel and joins with a bounded timeout; stop giving Flags an owning clone so the processor's lifetime is tied to Flagsmith alone.
- Leave it best-effort and document it.
- Something else?
Following on from #55 / #57, the analytics thread now flushes buffered counts when its last sender drops, but nothing waits for that flush to finish.
We can fix that, however, we need to make design decisions around
AnalyticsProcessorlifecycle to find the best place to block at. Right now,AnalyticsProcessorclones owned byFlagscan outliveFlagsmith, which is arguably wrong.Options
shutdown()onFlagsmiththat closes the channel and joins with a bounded timeout; stop givingFlagsan owning clone so the processor's lifetime is tied toFlagsmithalone.