ReactiveX / RxCpp

Reactive Extensions for C++
Apache License 2.0
3.05k stars 395 forks source link

rxcpp::debounce not working as expected #469

Closed chaplin89 closed 5 years ago

chaplin89 commented 5 years ago

Hi, I want to receive some messages from the network and apply a debounce filter. I wrote this simple code:

    auto received_messages = Rx::range(1, Rx::observe_on_new_thread()) |
        Rx::map([&](int) { return client.Receive(); }) |
        Rx::debounce(std::chrono::milliseconds(800), Rx::observe_on_new_thread());

I'm receiving tons of messages, but the subscriber seems to be called on random moments. What I'm doing wrong?

Thanks!

kirkshoop commented 5 years ago

Did you want debounce or sample_with_time?

chaplin89 commented 5 years ago

Sorry, silly mistake! Thanks!