how do I poll with Rx? I want to keep querying an ...
# rx
o
how do I poll with Rx? I want to keep querying an endpoint until its content include some value, and I want to be querying it 2 seconds apart for example until that result is found
b
I haven't actually used Rx productively in a while, but I would assume something like:
Copy code
interval(2.seconds)
  .flatMap {
     // create observable that queries endpoint
   }
   .takeUntil {
     // it has expected content
   }
o
ahh interval
thank you
actually inside
takeUntil
i get back an Observer<in Transaction>
I cannot check whether i have the value im looking for or not until I’ve subscribed and it comes back
oh I can give the takeUntil the value type im expecting and check that
but who will give it magically to takeUntil?
m
you can use filter - take1 or other variant