reflex icon indicating copy to clipboard operation
reflex copied to clipboard

Sampling and async performEvent are incompatible

Open mpickering opened this issue 4 years ago • 0 comments

The core of my application is built around a rule type which is essentially an IO action with the ability to sample dynamics. As the IO action runs it samples different dynamics depending on what the rule is.

Unfortunately all these actions have to run in the same thread as given the current implementation of performEventAsync the action must only be of type IO.

However, I believe it should be safe to sample a Dynamic from a different thread because sampling is just a read of the variable. This idea could already be implemented by sampling every dynamic in my program before passing a record of all the sampled values into the function. This is undesirable though and typically each rule is not using most of the Dynamics.

mpickering avatar Mar 16 '20 09:03 mpickering