Home Database Mysql Tutorial Reactive Extensions (Rx) 入门(2) 安装 Reactive Extensio

Reactive Extensions (Rx) 入门(2) 安装 Reactive Extensio

Jun 07, 2016 pm 03:26 PM
reactive getting Started Install

原文:http://www.atmarkit.co.jp/fdotnet/introrx/introrx_01/introrx_01_02.html 作者:河合 宜文 安装方法 关于 Rx 的安装,可以通过 Reactive Extensions (Rx) 的主页的直接下载安装,当然也可以利用 NuGet 导入 dll (http://nuget.org/packages/Rx-Main

原文:http://www.atmarkit.co.jp/fdotnet/introrx/introrx_01/introrx_01_02.html

作者:河合 宜文


安装方法

关于 Rx 的安装,可以通过 Reactive Extensions (Rx) 的主页 的直接下载安装,当然也可以利用 NuGet 导入 dll (http://nuget.org/packages/Rx-Main) [译注: NuGet 是VS集成的在线 dll部署工具,非常方便]。Rx 不管是 Installer 还是 NuGet 安装的,都有 Stable(稳定版) 和 Experimental(实验版) 两种。

Stable版是API中方法名等不会再变更而Experimental版则是在Stable版中加入了一些实验性的方法等。例如:C# 5.0中新增特性await/async关键字、Expand方法等只在Experimental版中有。只在Experimental版中有的方法会以[ExperimentalAttribute]特性标识,在Visual Studio中通过metadata的表示可以区分出来。因此,在利用Experimental版的时候,这些加上[ExperimentalAttribute]特性标识的方法将来方法名,参数列表还是有可能发生变化的,需要留意。

另外,Experimental版在现在Developer Preview(开发者预览版)中的.NET Framework 4.5和WinRT(Windows 8 运行环境)中已经包含了。C#5.0中特别是针对异步编程比较大的变化策略,已经在反映在Experimental版中。


Assembly分类
Rx的Assembly按照如下功能划分。

程序集名 NuGet Package名(*1 功能
System.Reactive Rx-Main 基本Core API
System.Reactive.Windows.Forms Rx-WinForms WindowsForm中使用的 ControlScheduler类(*2)和扩展方法
System.Reactive.Windows.Threading Rx-WPF
Rx-Silverlight
WPF/Silverlight中使用的DispatcherScheduler类(*2)和扩展方法
System.Reactive.Providers Rx-Providers IQbservable接口和其他类库(*3
Microsoft.Reactive.Testing Rx-Testing UnitTest和Mockup
Rx的Assembly一览
Rx的Assembly文件、一般放在「C:\Program Files\Microsoft Reactive Extensions SDK」(32bit版),而64bit版则是放在「C:\Program Files (x86)\Microsoft Reactive Extensions SDK」)
*1 一览中提到的Package是指Stable版,Experimental版的时候则带有「_Experimental」比如:「Rx_Experimental-Main」
*2 Scheduler 是基于Rx的时间和线程管理的类。ControlScheduler类是对于WinForm及控件进行BeginInvoke调用,DispatcherScheduler类是对Dispatcher进行BeginInvoke。
*3 「IQbservable」接口名取自「Queryable Observable」。表达式树可以生成一个 Observable 对象。IObservable 接口和 IQbservable 接口的关系就和 IEnumerable 接口和 IQueryable 接口关系相当。
作为Core必须引用 System.Reactive 程序集,除此之外可以按需添加引用,比如:如果要使用WPF,那么还要引用 System.Reactive.Windows.Threading。
Windows Phone 7 SDK 里集成的标准的 Rx 程序集则和上面说的有些不同:
程序集名 功能
System.Observable IObservable/IObserver接口
Microsoft.Phone.Reactive Core API和DispatcherScheduler类
Reactive Extensions (Rx) 入门(2)  安装 Reactive Extensio
Windows Phone 7 SDK的程序集一览
 Windows Phone 7 里也可以通过直接引用 Data Developer Center 里发布的程序集来使用 Rx,但是注意一下两者的区别,Data Developer Center 版是为了以后,API 有些是不同的。这些差异比如:命名空间不同,类名也有些不同,方法的参数列表也不同,有增加的方法也有删除的方法。总的来说,Data Developer Center 版应该提供了高性能和更强大功能的。
如果更加重视是否是使用标准程序集且不需要额外引用程序集,那么直接使用 Microsoft.Phone.Reactive;如果希望能在 WPF,Sliverlight 中移植,那么就选择 Data Developer Center 版本好了。

相关的库
Javascript 版本并不包含在Install 中,但可以从 Rx 主页最下方下载 ZIP 得到。库的主体是 Rx.js ,除此之外还有 jQuery 和 prototype.js。

命名空间分类
Rx 主要是以扩展方法为中心的,如果没有正确的使用 using/Import 导入命名空间则无法使用。下面例举主要的命名空间以及代表的功能和类。
名前空間 功能点
System

Subscribe订阅 IObservable 接口使用的Lambda表达式的扩展方法

System.Reactive

主要接口和一些基本类

System.Reactive.Concurrency 实现 IScheduler 接口的一些类
System.Reactive.Disposables 实现 IDisposable 接口的一些类
System.Reactive.Joins 利用 Observable.And/Observable.Then 方法进行Join操作的类
System.Reactive.Linq Rx 主要的命名空间,Observable 类和IObservable接口的一些扩展方法
System.Reactive.Subjects

实现 ISubject 接口(实现 Rx 语义的事件)的一些类

System.Reactive.Threading.Tasks

Task 相互转换的扩展方法

Reactive Extensions (Rx) 入门(2)  安装 Reactive Extensio

Rx 的命名空间和代表性的功能以及类


另外,Windows Phone 中,Microsoft.Phone.Reactive 程序集里的 Rx 全部在 Microsoft.Phone.Reactive 命名空间下。

【系列文章】
Reactive Extensions (Rx) 入门(1) —— Reactive Extensions 概要
Reactive Extensions (Rx) 入门(2) —— 安装 Reactive Extensions
Reactive Extensions (Rx) 入门(3) —— Rx的事件编程①
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
2 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Repo: How To Revive Teammates
4 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Hello Kitty Island Adventure: How To Get Giant Seeds
4 weeks ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

A Diffusion Model Tutorial Worth Your Time, from Purdue University A Diffusion Model Tutorial Worth Your Time, from Purdue University Apr 07, 2024 am 09:01 AM

Diffusion can not only imitate better, but also "create". The diffusion model (DiffusionModel) is an image generation model. Compared with the well-known algorithms such as GAN and VAE in the field of AI, the diffusion model takes a different approach. Its main idea is a process of first adding noise to the image and then gradually denoising it. How to denoise and restore the original image is the core part of the algorithm. The final algorithm is able to generate an image from a random noisy image. In recent years, the phenomenal growth of generative AI has enabled many exciting applications in text-to-image generation, video generation, and more. The basic principle behind these generative tools is the concept of diffusion, a special sampling mechanism that overcomes the limitations of previous methods.

Generate PPT with one click! Kimi: Let the 'PPT migrant workers' become popular first Generate PPT with one click! Kimi: Let the 'PPT migrant workers' become popular first Aug 01, 2024 pm 03:28 PM

Kimi: In just one sentence, in just ten seconds, a PPT will be ready. PPT is so annoying! To hold a meeting, you need to have a PPT; to write a weekly report, you need to have a PPT; to make an investment, you need to show a PPT; even when you accuse someone of cheating, you have to send a PPT. College is more like studying a PPT major. You watch PPT in class and do PPT after class. Perhaps, when Dennis Austin invented PPT 37 years ago, he did not expect that one day PPT would become so widespread. Talking about our hard experience of making PPT brings tears to our eyes. "It took three months to make a PPT of more than 20 pages, and I revised it dozens of times. I felt like vomiting when I saw the PPT." "At my peak, I did five PPTs a day, and even my breathing was PPT." If you have an impromptu meeting, you should do it

How to install Android apps on Linux? How to install Android apps on Linux? Mar 19, 2024 am 11:15 AM

Installing Android applications on Linux has always been a concern for many users. Especially for Linux users who like to use Android applications, it is very important to master how to install Android applications on Linux systems. Although running Android applications directly on Linux is not as simple as on the Android platform, by using emulators or third-party tools, we can still happily enjoy Android applications on Linux. The following will introduce how to install Android applications on Linux systems.

All CVPR 2024 awards announced! Nearly 10,000 people attended the conference offline, and a Chinese researcher from Google won the best paper award All CVPR 2024 awards announced! Nearly 10,000 people attended the conference offline, and a Chinese researcher from Google won the best paper award Jun 20, 2024 pm 05:43 PM

In the early morning of June 20th, Beijing time, CVPR2024, the top international computer vision conference held in Seattle, officially announced the best paper and other awards. This year, a total of 10 papers won awards, including 2 best papers and 2 best student papers. In addition, there were 2 best paper nominations and 4 best student paper nominations. The top conference in the field of computer vision (CV) is CVPR, which attracts a large number of research institutions and universities every year. According to statistics, a total of 11,532 papers were submitted this year, and 2,719 were accepted, with an acceptance rate of 23.6%. According to Georgia Institute of Technology’s statistical analysis of CVPR2024 data, from the perspective of research topics, the largest number of papers is image and video synthesis and generation (Imageandvideosyn

A must-read for technical beginners: Analysis of the difficulty levels of C language and Python A must-read for technical beginners: Analysis of the difficulty levels of C language and Python Mar 22, 2024 am 10:21 AM

Title: A must-read for technical beginners: Difficulty analysis of C language and Python, requiring specific code examples In today's digital age, programming technology has become an increasingly important ability. Whether you want to work in fields such as software development, data analysis, artificial intelligence, or just learn programming out of interest, choosing a suitable programming language is the first step. Among many programming languages, C language and Python are two widely used programming languages, each with its own characteristics. This article will analyze the difficulty levels of C language and Python

How to Install and Run the Ubuntu Notes App on Ubuntu 24.04 How to Install and Run the Ubuntu Notes App on Ubuntu 24.04 Mar 22, 2024 pm 04:40 PM

While studying in high school, some students take very clear and accurate notes, taking more notes than others in the same class. For some, note-taking is a hobby, while for others, it is a necessity when they easily forget small information about anything important. Microsoft's NTFS application is particularly useful for students who wish to save important notes beyond regular lectures. In this article, we will describe the installation of Ubuntu applications on Ubuntu24. Updating the Ubuntu System Before installing the Ubuntu installer, on Ubuntu24 we need to ensure that the newly configured system has been updated. We can use the most famous "a" in Ubuntu system

How to install Podman on Ubuntu 24.04 How to install Podman on Ubuntu 24.04 Mar 22, 2024 am 11:26 AM

If you have used Docker, you must understand daemons, containers, and their functions. A daemon is a service that runs in the background when a container is already in use in any system. Podman is a free management tool for managing and creating containers without relying on any daemon such as Docker. Therefore, it has advantages in managing containers without the need for long-term backend services. Additionally, Podman does not require root-level permissions to be used. This guide discusses in detail how to install Podman on Ubuntu24. To update the system, we first need to update the system and open the Terminal shell of Ubuntu24. During both installation and upgrade processes, we need to use the command line. a simple

From bare metal to a large model with 70 billion parameters, here is a tutorial and ready-to-use scripts From bare metal to a large model with 70 billion parameters, here is a tutorial and ready-to-use scripts Jul 24, 2024 pm 08:13 PM

We know that LLM is trained on large-scale computer clusters using massive data. This site has introduced many methods and technologies used to assist and improve the LLM training process. Today, what we want to share is an article that goes deep into the underlying technology and introduces how to turn a bunch of "bare metals" without even an operating system into a computer cluster for training LLM. This article comes from Imbue, an AI startup that strives to achieve general intelligence by understanding how machines think. Of course, turning a bunch of "bare metal" without an operating system into a computer cluster for training LLM is not an easy process, full of exploration and trial and error, but Imbue finally successfully trained an LLM with 70 billion parameters. and in the process accumulate

See all articles