Rx in .Net 3.5 not asynchronous?

I play with Rx in .Net3.5SP1 and try 101 Rx Samples . I am trying to execute the first example (Start - Run Code Asynchronously), but it does not seem to work asynchronously. For example,

        Console.WriteLine("[Creating]");
        var o = Observable.Start(() => 
        {
            Console.WriteLine("Calculating..."); 
            Thread.Sleep(3000); 
            Console.WriteLine("Done."); 
        });
        Console.WriteLine("[Created]");
        Console.WriteLine("[Starting]");
        o.First();   // subscribe and wait for completion of background operation
        Console.WriteLine("[Started]");

Outputs

[Creating]
[Created]
[Starting]
Calculating...
    <...3 Second Wait...>
Done.
[Started]

Is there any explanation for this? Am I doing something wrong? Is this expected behavior?

UPDATE

I would think I would say

[Creating] 
[Created] 
[Starting] 
Calculating... 
[Started] 
    <...3 Second Wait...> 
Done. 

But the main thread is blocked while the alleged Asynch call is taking place.

+5
source share
3 answers

It looks reasonably expected for me.

Thread.Sleep "" "", , "", , . , .

, First() , , - "" , , - : 1; 2. , Prune, .

+1

// subscribe and wait for completion of background operation , . , , , (Console.WriteLine("[Started]");), , ?

+1

First it blocks ... What you want is signed:

        public static void Main(string[] args) {

        Console.WriteLine("[Creating]");
        var o = Observable.Start(() =>
        {
            Console.WriteLine("Calculating...");
            Thread.Sleep(3000);

        });
        Console.WriteLine("[Created]");
        Console.WriteLine("[Starting]");

        o.Subscribe(_ => Console.WriteLine("Done."));   // subscribe and wait for completion of background operation 

        Console.WriteLine("[Started]");

        Console.ReadKey();
    }
+1
source

All Articles