Erlang/OTP gen_server implementation with priorities