Skip to content

Support handle_continue #227

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
palm86 opened this issue Apr 2, 2019 · 8 comments
Closed

Support handle_continue #227

palm86 opened this issue Apr 2, 2019 · 8 comments

Comments

@palm86
Copy link

palm86 commented Apr 2, 2019

As part of the start-up of a Producer, I have a longer running piece of code that needs to execute. Doing it in the init seems wrong now that handle_continue exists. But GenStage doesn't support handle_continue. I don't know if it can/should, but it would be a useful addition.

@josevalim
Copy link
Member

We could support it. PRs are welcome.

@josevalim
Copy link
Member

Closing in favor of the PR.

@adherr
Copy link

adherr commented Jul 13, 2020

I would like to use handle_continue after demand and info callbacks. I'm not in a place right now to pick up the PR. Would you like to track this in an open issue, either reopening this one or I could create a new one? Otherwise, this closed issue has enough information for someone like me who is looking for this feature.

@josevalim josevalim reopened this Jul 13, 2020
@hazardfn
Copy link

@josevalim I am going to pick this up later today. While trying to get familiar with the project yesterday evening I noticed in the docs it is stated :hibernate on init/1 is supported as a 3rd tuple argument in the return (https://github.com/elixir-lang/gen_stage/blob/master/lib/gen_stage.ex#L837).

Looking at the init code I don't see where this is picked up and it isn't included in the type-specs - as handling for options like :hibernate at this level are related in a sense to {:continue, term} I'd like to understand if this is a misprint or I'm actually missing something fundamental in how these are handled. If it is a misprint I am also happy to fix support for :hibernate on init in a separate commit or PR depending on preference 👍

@palm86
Copy link
Author

palm86 commented Sep 18, 2020

@hazardfn There is this abandoned PR: #234 I never got around to doing the tests, but iirc, the code "works", whatever that means without tests.

@hazardfn
Copy link

@palm86 great! This very question was answered in the PR 😄. If you have no plans to work on it further I'm happy to pick it up and finish the rest?

@palm86
Copy link
Author

palm86 commented Sep 18, 2020 via email

@whatyouhide
Copy link
Member

Closing again in favor of the PR #264.

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

No branches or pull requests

5 participants