I am using RX to create an Asynchronous Web request. Is there a good scheduler to invoke a Web Request at a predefined time? I am confused which one to use: Task Scheduler or RX Scheduler.
Asked
Active
Viewed 268 times
2 Answers
0
The Rx Scheduler and Task scheduler are different things. Rx Scheduler is used to helps an IObservable "schedule" it's subscription appropriately (refer this SO question). Where as Task scheduler are how a Task (which is a abstract concept) will be executed i.e on same thread OR in thread pool etc. You want to generate a Async Web request at a specified time, for that you can use any of the Timer objects from BCL.
0
If you're using Rx I'd stick with Rx.
Try using this to schedule your web request:
Scheduler.ThreadPool
.Schedule(
DateTimeOffset.Now.AddHours(1.0),
() => { /* Do web request */ });

Enigmativity
- 113,464
- 11
- 89
- 172