From 05061e98d9dec44e96f77cf3829eb4e0db087143 Mon Sep 17 00:00:00 2001 From: s_arme Date: Sat, 13 Feb 2021 03:32:12 +0330 Subject: [PATCH] Define delay param --- lib/procon.ex | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/procon.ex b/lib/procon.ex index 170c9c0..48907cb 100644 --- a/lib/procon.ex +++ b/lib/procon.ex @@ -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)