fireproofsocks
How to stop/restart a GenStage pipeline
I have an app running GenStage that use a producer stage to buffer/rate-limit work that we manually send to it. However, sometimes we make mistakes and we might want to stop the music and reset the particular producer stage that has accumulated all the unwanted messages. I’m discovering that this is trickier than I thought. Using Process.exit(my_buffer_pid, :normal) returned true, but when I inspected the buffer via GenStage.estimate_buffered_count/2, all the messages were still there.
Is there a better way to do this? Like…maybe I should be flushing the messages instead of attempting a restart? Or maybe GenStage.stop/3 is the way to go?
Thanks as always for any pointers!
First Post!
dimitarvp
I have not used GenStage in a while. Can you show a more detailed example though?
Popular in Questions
Other popular topics
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #deployment
- #library
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #channels
- #elixirconf
- #exunit
- #discussion
- #code-sync
- #javascript
- #podcasts
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixir-ls
- #phoenix_html
- #iex
- #blog-post
- #graphql
- #genstage
- #ai
- #websockets
- #supervisor
- #advent-of-code
- #elixirconf-us
- #distillery
- #processes
- #forms
- #api
- #metaprogramming
- #security
- #performance









