You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I’ve not done this exactly thing before but you may be able to get away without using any concurrency related stuff to get this behavior. You should be able to write a function that consumes a stream, sampling the system clock every time an element comes in. It can buffer things until the right amount of time has elapsed. But it could run into weird situations where the buffer wouldn’t clear until a new element showed up. So, you’d probably need a timer running concurrently to address that.
What I most often need is something that is rate-limited by some external service. Say I must guarantee that I don't do more than X requests/second.
I'm not sure if this is supported by the parallelism modes.
I guess it's possible to use
asyncly
and then consume usingControl.Concurrent.Async.race System.Sleep.sleep (1/rate) restOfComputation
.?
The text was updated successfully, but these errors were encountered: