Skip to content
This repository has been archived by the owner on Aug 14, 2023. It is now read-only.

Graceful shutdown of buffers #63

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

begleynk
Copy link

Hi! Not sure if you're still interested in maintaining this library but I came across it and it seemed to fit my needs very nicely.

Motivation

Closes #10

It would be nice if we didn't drop events on e.g. restarts.

Proposed solution

I added a terminate GenServer callback that invokes flush on each buffer. Test included.

In order to make a couple tests not explode when their terminate callbacks were run, I ended up creating a graceful_shutdown flag which is on by default, but can be disabled for those tests. I'm not super happy with that solution, but I couldn't get Mox.stub to work for those tests either.

If you have a better testing strategy, I'd be happy to investigate.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support graceful shutdown
1 participant