   def handle_call({:operation, op_name, args}, from, %{session_id: sid} = s) do
     req = Protocol.encode_op(op_name, [sid|args])
 
-    s = update_in(s.queue, &:queue.in({from, op_name}, &1))
+    s = enqueue(s, {from, op_name})
 
     :gen_tcp.send(s.socket, req)
     {:noreply, s}


    %{global_properties: global_properties}
  end
end

  def handle_info(msg, state)

  def handle_info({:tcp, socket, msg}, %{session_id: sid, socket: socket} = s) do
    :inet.setopts(socket, active: :once)
    data = s.tail <> msg

