Entries:
Comments:
Posts:

Loading User Information from Channel 9

Something went wrong getting user information from Channel 9

Latest Achievement:

Loading User Information from MSDN

Something went wrong getting user information from MSDN

Visual Studio Achievements

Latest Achievement:

Loading Visual Studio Achievements

Something went wrong getting the Visual Studio Achievements

Wes Dyer

Wes Dyer Wes Dyer

Niner since 2009

  • Wes Dyer: Controlling Concurrency in Rx

    You certainly could vary the speed of "virtual threads" independently.  We have only begun to investigate the possibilities here.  I encourage you to play around with it and see what you can come up with.

  • Rx API in depth: Concat, Catch and OnErrorResumeNext

    ContinueWith is a good idea.  In fact, it already exists in Rx and is an overload of SelectMany.  The only difference is that the SelectMany can continueWith on OnNext, onCompleted, or OnError.  This is the correct overload:

     

    IObservable<T>.SelectMany(Func<Notification<T>, IObservable<U>)

     

    Also note that Concat has the same semantics in Rx that is does in Linq to Objects.  Namely that the subscription to the second source doesn't happen until the first source has completed.

  • Rx API in depth: Hot and Cold observables

    Hot = Running

    Cold = Not Running

     

    Static/Dynamic would be misleading.  Immutable/Mutable is also misleading.  Perhaps, the closest terms are Deferred / Not-Deferred or Latent / Active.

     

    The terms Hot and Cold came from whiteboarding and design sessions where we needed a term to describe the difference between something that running versus something that represents a thing that can be run.  We definitely didn't sit down and figure out a vocabulary, these things just happen.  I'm sure that at some point in time people will think about standard terminology, but we usually can't wait for that to happen.

  • Writing your first Rx Application

    Unfortunately, it has nothing to do with Rx.  And if you reported it as a VB bug then the VB team would correctly say that it is by design.  Which probably means that it is a bug in the user code.

     

    Now, understandably this is a rather confusing bug, and I tend to think that overloading "=" to be either relational equality or assignment leads to some rather interesting cases and so I personally think that VB is rather confusing here.

  • Reactive Extensions API in depth: Primitives

    Good question.

     

    We have gone back and forth on this issue over time, but I expect in the long run that the user can choose either one since they both have meaningful semantics.

  • Writing your first Rx Application

    Did you set the Observable.Context correctly?

     

    What does the code look like?

  • Writing your first Rx Application

    I tried it out and it seems that the anonymous functions in VB are getting in the way.  If you write it without anonymous functions then it works fine.  The reason is that assignment is a statement and so cannot be an expression and therefore not in an anonymous function.  Instead, the = becomes the equality operator so each time the interval fires it checks to see if the form's text is equal to the current textual representation of the interval's value: obviously wrong.

     

    Here is the fix:

    Imports System.Threading
    Public Class Form1
        Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
            Observable.Context = SynchronizationContexts.WindowsForms
            Dim xs = Observable.Interval(TimeSpan.FromSeconds(1))
            xs.Subscribe(AddressOf Foo)
        End Sub
        Private Sub Foo(ByVal X As Long)
            Me.Text = X.ToString
        End Sub
    End Class