Given most use cases of GenServer/Agent.start_link are to expose similar
callbacks through your own modules, I would recommend providing
MyApp.Server.start_link! yourself as I don't see many use cases to justify
its addition to Elixir.



*José Valim*
www.plataformatec.com.br
Skype: jv.ptec
Founder and Director of R&D

On Thu, Dec 22, 2016 at 7:34 PM, Wiebe-Marten Wijnja <
[email protected]> wrote:

> Nearly always, when starting a GenServer (or Agent or ...) from a process
> (so not inside a supervision tree),
> the process doing the starting does not have a reasonable behaviour to
> continue in the case that the starting fails
> (other than to itself crash).
>
> GenServer.start and GenServer.start_link (and Agent.start,
> Agent.start_link, etc.) return an `{:ok, pid}` tuple. (or `{:error, info}`)
>
> I am wondering if it would be possible to introduce GenServer.start! and
> GenServer.start_link! (and item for Agent, ...)
> that return just the `pid` (and crash on failure).
> The main advantage of this is that start and start_link cannot be
> incorporated into pipelines, as they return a tuple, whereas
> the bang-versions would.
>
> Would this be a good idea, or has a conscious choice been made to *not*
> include bang-versions of GenServer.start and GenServer.start_link (and
> variants)?
>
> --
> 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/440b9098-0adf-458e-8f5e-
> 366dcbe9e6c4%40googlegroups.com
> <https://groups.google.com/d/msgid/elixir-lang-core/440b9098-0adf-458e-8f5e-366dcbe9e6c4%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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/CAGnRm4JPdxm7Vc94biF4-oLcyRkF5aQQgU5z3NfKQ_uZmB4%2BUA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to