It's important to understand that `use GenServer` is not directly related
to the behavior. It is a macro that calls GenServer.__using__ which happens
to add @behaviour :gen_server to the current module as well as define
default implementations for the callbacks.

For :gen_server2, you just have to do all that yourself. Otherwise it
should work fine.

On Mon, Jul 25, 2016, 7:03 AM OvermindDL1 <[email protected]> wrote:

> Except in this case instead of `use` it would be `@behaviour gen_server2`,
> but yes you can.
>
>
> On Monday, July 25, 2016 at 7:11:32 AM UTC-6, Santiago Fernandez wrote:
>>
>> Hi,
>>
>> Is it possible to add gen_server2 [1] behaviour to a Elixir app? (`use
>> GenServer2` instead `use GenServer`)
>> I'd like to prioritize incoming messages and set timeouts previous to
>> process hibernation.
>>
>> [1]
>> https://github.com/muxspace/rabbit_common/blob/master/src/gen_server2.erl
>>
>> Thanks!
>>
>> --
>> Santiago
>>
> --
> You received this message because you are subscribed to the Google Groups
> "elixir-lang-talk" 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-talk/7abdaf00-7021-4ddc-9b9e-6f3710b4bb19%40googlegroups.com
> <https://groups.google.com/d/msgid/elixir-lang-talk/7abdaf00-7021-4ddc-9b9e-6f3710b4bb19%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-talk" 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-talk/CAOMhEnyicmWaKhHFEfQZRY829Sdqj6n1FaBRc3fWVNZTGots_w%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to