在.NET 3.5接收扩展Threading.Tasks模拟? [英] Threading.Tasks analog in Rx extensions in .NET 3.5?

查看:551
本文介绍了在.NET 3.5接收扩展Threading.Tasks模拟?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有可能使用无功扩展(Rx)的创建在.NET 3.5执行并行还是有限的在某些方面的应用?我下载的Rx从这里 http://www.microsoft.com/download/ EN / confirmation.aspx?ID = 26649 ,并创建具有参考反应组件一个简单的项目后,我没能找到相应的任务在.NET 4.0中的所有类。我试图寻找类'任务',但可惜我找不到任何。难道我做错了什么?

Is it possible to use Reactive Extensions (Rx) to create applications in .NET 3.5 that perform parallelization or is it limited in some way? I downloaded Rx from here http://www.microsoft.com/download/en/confirmation.aspx?id=26649 and after creating a simple project with referenced reactive assemblies, I failed to find any classes corresponding to Tasks in .NET 4.0. I'm trying to find classes for 'Task', but alas I can not find any. Am I doing something wrong?

推荐答案

也许从RX维基样品可以帮你。

Maybe the samples from the rx wiki can help you.

最简单的后台任务将是:

The simplest background task would be:

var o = Observable.Start
(
    () => 
    { 
        Console.WriteLine("Calculating..."); 
        Thread.Sleep(3000); 
        Console.WriteLine("Done."); 
    }
);

o.First();   // subscribe and wait for completion of background operation

但你也可能想看看forkjoin例子。

But you may also want to look at the forkjoin examples.

这篇关于在.NET 3.5接收扩展Threading.Tasks模拟?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆