       timeout: Keyword.get(options, :timeout, :infinity)}
   end
 
-  @doc """
-  Adds a new event handler to the event `manager`.
-
-  The event manager will call the `c:init/1` callback with `args` to
-  initiate the event handler and its internal state.
-
-  If `c:init/1` returns a correct value indicating successful completion,
-  the event manager adds the event handler and this function returns
-  `:ok`. If the callback fails with `reason` or returns `{:error, reason}`,
-  the event handler is ignored and this function returns `{:error, reason}`.
-
-  If the given handler was previously installed at the manager, this
-  function returns `{:error, :already_present}`.
-
-  For installing multiple instances of the same handler, `{Module, id}` instead
-  of `Module` must be used. The handler could be then referenced with
-  `{Module, id}` instead of just `Module`.
-  """
   @spec add_handler(manager, handler, term) :: :ok | {:error, term}
   def add_handler(manager, handler, args) do
     rpc(manager, {:add_handler, handler, args})
   end
 
-  @doc """
-  Adds a monitored event handler to the event `manager`.
-
-  Expects the same input and returns the same values as `add_handler/3`.
-
-  ## Monitored handlers
-
-  A monitored handler implies the calling process will now be monitored
-  by the GenEvent manager.
-
-  If the calling process later terminates with `reason`, the event manager
-  will delete the event handler by calling the `c:terminate/2` callback with
-  `{:stop, reason}` as argument. If the event handler later is deleted,
-  the event manager sends a message `{:gen_event_EXIT, handler, reason}`
-  to the calling process. Reason is one of the following:
-
-    * `:normal` - if the event handler has been removed due to a call to
-      `remove_handler/3`, or `:remove_handler` has been returned by a callback
-      function
-
-    * `:shutdown` - if the event handler has been removed because the event
-      manager is terminating
-
-    * `{:swapped, new_handler, pid}` - if the process PID has replaced the
-      event handler by another
-
-    * `term` - if the event handler is removed due to an error. Which term
-      depends on the error
-
-  Keep in mind that the `{:gen_event_EXIT, handler, reason}` message is not
-  guaranteed to be delivered in case the manager crashes. If you want to
-  guarantee the message is delivered, you have two options:
-
-    * monitor the event manager
-    * link to the event manager and then set `Process.flag(:trap_exit, true)`
-      in your handler callback
-
-  Finally, this functionality only works with GenEvent started via this
-  module (it is not backwards compatible with Erlang's `:gen_event`).
-  """
   @spec add_mon_handler(manager, handler, term) :: :ok | {:error, term}
   def add_mon_handler(manager, handler, args) do
     rpc(manager, {:add_mon_handler, handler, args, self()})
   end
 
-  @doc """
-  Sends an event notification to the event `manager`.
-
-  The event manager will call `c:handle_event/2` for each
-  installed event handler.
-
-  `notify` is asynchronous and will return immediately after the
-  notification is sent. `notify` will not fail even if the specified
-  event manager does not exist, unless it is specified as an atom.
-  """
   @spec notify(manager, term) :: :ok
   def notify(manager, event)
 

    :ok
  end

  @doc """
  Sends a sync event notification to the event `manager`.

  In other words, this function only returns `:ok` after the event manager
  invokes the `c:handle_event/2` callback on each installed event handler.

  See `notify/2` for more info.
  """
  @spec sync_notify(manager, term) :: :ok
  def sync_notify(manager, event) do
    rpc(manager, {:sync_notify, event})
  end

  @doc """
  Sends an ack event notification to the event `manager`.

  In other words, this function only returns `:ok` as soon as the
  event manager starts processing this event, but it does not wait
  for event handlers to process the sent event.

  See `notify/2` for more info. Note this function is specific
  to Elixir's GenEvent and does not work with Erlang ones.
  """
  @spec ack_notify(manager, term) :: :ok
  def ack_notify(manager, event) do
    rpc(manager, {:ack_notify, event})
  end

  @doc """
  Makes a synchronous call to the event `handler` installed in `manager`.

  The given `request` is sent and the caller waits until a reply arrives or
  a timeout occurs. The event manager will call `c:handle_call/2` to handle
  the request.

  The return value `reply` is defined in the return value of `c:handle_call/2`.
  If the specified event handler is not installed, the function returns
  `{:error, :not_found}`.
  """
  @spec call(manager, handler, term, timeout) ::  term | {:error, term}
  def call(manager, handler, request, timeout \\ 5000) do
    try do

defmodule GenEvent do
  # TODO: Deprecate by 1.6 (hard deprecation)

  @moduledoc """
  WARNING: this module is deprecated.

  If you need the same functionality, you can use the `:gen_event` Erlang
  module.
  """

  @callback init(args :: term) ::
    {:ok, state} |
    {:ok, state, :hibernate} |
    {:error, reason :: any} when state: any

  @callback handle_event(event :: term, state :: term) ::
    {:ok, new_state} |
    {:ok, new_state, :hibernate} |
    :remove_handler when new_state: term

  @callback handle_call(request :: term, state :: term) ::
    {:ok, reply, new_state} |
    {:ok, reply, new_state, :hibernate} |
    {:remove_handler, reply} when reply: term, new_state: term

  @callback handle_info(msg :: term, state :: term) ::
    {:ok, new_state} |
    {:ok, new_state, :hibernate} |
    :remove_handler when new_state: term

  @callback terminate(reason, state :: term) ::
    term when reason: :stop | {:stop, term} | :remove_handler | {:error, term} | term

  @callback code_change(old_vsn, state :: term, extra :: term) ::
    {:ok, new_state :: term} when old_vsn: term | {:down, term}

  @type on_start :: {:ok, pid} | {:error, {:already_started, pid}}

  @type name :: atom | {:global, term} | {:via, module, term}

  @type options :: [name: name]

  @type manager :: pid | name | {atom, node}

  @type handler :: atom | {atom, term}

  @doc false
