I misunderstood the enter_loop function, I'm not fine with that as the
API after all.

2016-05-15 19:54 GMT+02:00 Saša Jurić <[email protected]>:
> I'd call the callback
> post_init, and make it non-optional. The callback then becomes a part of the
> GenServer lifecycle, and there are no changes to return tuples from init/1.
> The __using__ macro of GenServer could provide the default impl, which would
> do nothing, thus ensuring that there are no breaking changes.

I like the name post_init better.

The problems I see with an implicitly invoked callback are:
- it silently fails on older versions leaving the process not
initialized, while returning an unknown tuple would cause an error
- the initialization params need to be passed through state, so if
they are not normally part of the state now I need some additional
field to store them.

-- 
You received this message because you are subscribed to the Google Groups 
"elixir-lang-core" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/elixir-lang-core/CAGAFNpnuiXOLP%2BuhUWGzm5XaDFYo35Lpz4NZdbNurtV4druvVQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to