Skip to content

Commit

Permalink
Convert cast back to call
Browse files Browse the repository at this point in the history
  • Loading branch information
chrismcg committed Nov 11, 2014
1 parent d6a4d27 commit 790541b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions apps/simple_cache/lib/simple_cache/element.ex
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ defmodule SimpleCache.Element do

def replace(pid, value), do: GenServer.cast(pid, { :replace, value })

def delete(pid), do: GenServer.cast(pid, :delete)
def delete(pid), do: GenServer.call(pid, :delete)

## Callbacks

Expand Down Expand Up @@ -53,7 +53,7 @@ defmodule SimpleCache.Element do
{ :reply, { :ok, value }, state, time_left(start_time, lease_time) }
end

def handle_cast(:delete, state), do: { :stop, :normal, state }
def handle_call(:delete, _from, state), do: { :stop, :normal, :ok, state }

def handle_cast({:replace, value}, %State{start_time: start_time, lease_time: lease_time} = state) do
{ :noreply, %{state | value: value}, time_left(start_time, lease_time) }
Expand Down

0 comments on commit 790541b

Please sign in to comment.