How could I implement deferred pattern in elixir?
Let me explain what it is. Let say I have some fn() which should be implemented with n seconds delay after now. But if I call this fn() second time this function should be implemented in n seconds after second call and so on. There should be a method to exit this function evaluation at all too.
You can take a look at Lodash's _.debounce function for the reference.
Okay here is a simplified case to get you going: here
nis not in seconds but loop-steps so you are going to need bign's to see any delays. Here I useIO.putsas an example of calling a function.