Skip to content

Commit

Permalink
Define delay param
Browse files Browse the repository at this point in the history
  • Loading branch information
alimoezzi committed Feb 13, 2021
1 parent 7f8e1b1 commit 05061e9
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/procon.ex
Original file line number Diff line number Diff line change
@@ -1,14 +1,18 @@
defmodule Procon.Producer do
use GenServer
@delay 1000

# client side
def start_link(_) do
GenServer.start_link(__MODULE__, [], name: {:global, :producer})
end

# get state from our process
def get do
# sync
GenServer.call({:global, :producer}, :get)
end

# server side /callback functions
def init(i) do
GenServer.cast({:global, :producer}, :produce)
Expand Down

0 comments on commit 05061e9

Please sign in to comment.