What is the best way in the elixir to create a foreground process that will be marked for every given time period?
My main problem is that an approach like:
defmoulde Ticker do def tick do do_something() :timer.sleep(1000) tick end end
works, but wrong in design. This is definitely not ticking every second, but every second PLUS time for do_something () to complete. I could spawn a “something” processing process, but there is still a slight lag.
In addition, I am trying to create a mixing application, there are some involved GenServers and the main foreground process (the one I ask here) that should call the servers every x seconds. Is there an otp way to do this?
elixir eventemitter otp
matteosister
source share