  @doc "Sends an event and returns only after the event is dispatched."
  @spec sync_notify(any, pos_integer | :infinity) :: :ok
  @spec sync_notify(pid | atom, any, pos_integer | :infinity) :: :ok
- def sync_notify(pid \\ __MODULE__, event, timeout \\ 5000) do
+ def sync_notify(pid \\ name(), event, timeout \\ 5000) do
    GenStage.call(pid, {:notify, event}, timeout)
  end
 
  @doc """
  Empties the queue of events.
  """
- def clear(pid \\ __MODULE__) do
+ def clear(pid \\ name()) do
    GenStage.call(pid, :clear)
  end
 
  @doc "Stops the EventCenter"
- def stop(pid \\ __MODULE__) do
+ def stop(pid \\ name()) do
    GenStage.stop(pid)
  end
 

##
###################################################

 @doc "Starts the EventCenter registered with the module's name."
 @spec start_link() :: {:ok, pid}
 def start_link() do
   GenStage.start_link(__MODULE__, :ok, name: __MODULE__)
 end
 @doc """
 Starts the EventCenter as an anonymous process which is not registered.

  Holds the internal state of the `EventCenter`.

  * `queue`: the queue of events
  * `demand`: the current demand of events to consume
  """
  @type t :: %__MODULE__{
    queue: :queue.queue,
