Friday, April 21, 2017

Task.Delay Challenge Solution This post suggest solution to the Task.Delay challenge. If you haven’t read the Task.Delay challenge you can find it here. In nutshell the challenge was about making Task.Delay like functionality which is test-able (using IScheduler for having virtual time). In order to support virtual time I will use Rx’s stream (which is also awaitable). The original Task.Delay is actually having 2 different completion path: - Complete by time. - Complete as result of cancellation token event. The general idea of the solution is to have 2 Rx’s streams one for each completion path: - Timer...

Tuesday, August 30, 2016

Rx Challenge #9: Execute Async Until Challenge #9 was about implementing a pattern where you have to keep sending async message until you will get notification which approve that the message is handled by the other side. see the full detail at the Challenge at this post. Simple scenario For the simple scenario of you calling service and retry sending, according to it’s response. You can use the following pattern. Code Snippet private static async Task VerySimpleScenario() { var delay = Observable.Timer(TimeSpan.FromSeconds(1)); var noDelay = Observable.Return(1L); var xs = Observable.FromAsync(() => ExecSimpleAsync(1))...

Friday, August 19, 2016

Rx Challenge #10: DistinctUntilChanged with expiration period This challenge is DistinctUntilChanged cancellation after a period. When having event stream which may produce items in a row and then be idle for a period. You may want to get item after a period even those it identical the the previous one. On challenge you need to construct it using composition of existing Rx’s operators. It can be formulate into the following pattern: Code Snippet public static IObservable<T> DistinctUntilChanged<T>( this IObservable<T> source, TimeSpan distinctPeriod) { // TODO: your code } ...

Tuesday, August 16, 2016

Rx Challenge #9: Execute Async Until This time the challenge is for implementing a pattern where you have to keep sending async message until you will get notification which approve that the message is handled by the other side. The idea is to verify that the message was handled by other side without keeping open connection and waiting for response (which already implement by the TCP protocol). This pattern can be useful on many scenarios, For example, any queue mechanism like Service Bus, Rabbit MQ, etc. Using this pattern you can keep sending the message using predefine interval...

Tuesday, August 2, 2016

.Visual Rx is having new Home and future plans Visual Rx is having new Home under GitHub. It had moved from CodePlex to GitHub and will be maintain on GitHub. The plans for Visual Rx future is to start new version from scratch. This version will have the following characteristic: - Support .NET Core. - Better organized. - API improvements. - Support more communication client out of the box. - Have Angular 2 viewer. After setting the foundation for this version I will post call for the community to join the effort. The final target of Visual Rx (if...

Wednesday, July 20, 2016

Visual Rx compatible with Rx 3.0.0 is available at NuGet. The client side can be download from here. When you open the viewer make sure you run it with administrator privilege, otherwise it won’t start. It need this level of trust because it open WCF hosting.