Quantcast
Channel: .NET Framework Class Libraries forum
Viewing all articles
Browse latest Browse all 8156

Reactive Extensions Throttle method

$
0
0

I want to Throttle a method call.

This method is called several times (and it writes to a file), so would be nice if it was called after 2 or 3 seconds.

I tried this, but it is calling each time:

Observable
                    .FromAsync(() => configurationRepository.UpdateConfiguration(sessionManager.CurrentTransmission))
                    .Throttle(TimeSpan.FromSeconds(2))
                    .Subscribe();

And the method signature:

public interface ITransmissionConfigurationRepository
    {
        Task UpdateConfiguration(Transmission transmission);
    }


Take a look at WPF FlashMessage
About.me


Viewing all articles
Browse latest Browse all 8156

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>