Clojure refs and add-watch -


say have ref state gets updated every 30 seconds , fn want attach may take longer complete. @ time 0 ref updated , fn called @ time 30 ref again updated fn still running. 2 copies of same function running or skip , execute @ time 60 assuming fn returns then?

edit: trying change state of ref. updated somewhere else trying use trigger control calculations.

if use ref 2 functions run in parallel , compete right produce next state of ref loser having run again.

this 1 of differences between refs , agents. agents run sequentially because have queue of functions waiting run on them.


Comments

Popular posts from this blog

c# - How to set Z index when using WPF DrawingContext? -

razor - Is this a bug in WebMatrix PageData? -

visual c++ - Using relative values in array sorting ( asm ) -