Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I am only passingly familiar with Reactive, but something stood out that didn't look right.</p> <pre><code>public string Execute1(string param) { var t = Observable.Start(() =&gt; Thread.Sleep(2000), Scheduler.NewThread); t.First(); return string.Format("Execute1 on: {0} count: {1} at: {2} thread: {3}", param, "0", DateTime.Now.ToString(), Thread.CurrentThread.ManagedThreadId.ToString()); } </code></pre> <p>In this code you are doing a <code>Thread.Sleep</code> in a new thread, followed by First(). The First() method blocks the current thread, so these two lines are no different to <code>Thread.Sleep(2000)</code>. That gets Reactive out of the way. If you run with this code you get the same result, indicating that you are not getting multithreading.</p> <p>The first logical cause of this is missing <code>ConcurrencyMode=ConcurrencyMode.Multiple</code>, which I understand you have tried. The next possibility is that you are running it on the built-in ASP.Net Development Server which, unless I am mistaken, does not support multithreading. Are you running it on an IIS instance?</p> <p>I am not sure what you are trying to achieve, but t.Take(1) is non-blocking.</p> <p><strong>Update</strong> The culprit is <code>aspNetCompatibilityEnabled="true"</code> in web.config. If it is included you get the behavior mentioned. If it is not included (default=false), you get multi-threading. I don't yet know the logic behind this. With it set to false you lose some features as described <a href="http://blogs.msdn.com/b/wenlong/archive/2006/01/23/516041.aspx" rel="nofollow">here</a>, including HttpContext and ASP.NET Sessions.</p> <p>** Further update ** If you turn off <code>aspNetCompatibilityEnabled</code>, you can't using routing. I have tried a number of combinations including different bindings and transferMode settings, and they fool you by seeming to work for a while, and then going back to using the same thread. I also checked worker threads and am running out of ideas.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload