##language:zh ''' Reactor 预览(Reactor Overview)''' -- dreamingk [<>] <> = Reacotr 基础(Reactor Basics) = This HOWTO introduces the Twisted reactor, describes the basics of the reactor and links to 这份HOWTO文档介绍了Twisted中的reactor,描述了reactor的基础和相关内容 == Reactor基础(Reactor Basics) == The reactor is the core of the event loop within Twisted -- the loop which drives applications using Twisted. The reactor provides basic interfaces to a number of services, including network communications, threading, and event dispatching. Reactor是Twisted事件循环的核心-使用Twiested的应用程序就是靠这个事件循环来驱动.Reactor提供了一些基本的服务接口,包括网络通讯,线程和事件分发. For information about using the reactor and the Twisted event loop, see: 关于如果如何使用reactor和Twisted事件循环,参见 the event dispatching howtos: Scheduling and Using Deferreds; the communication howtos: TCP servers, TCP clients, UDP networking and Using processes; and Using threads. 事件分发 howtos: "调度"和"使用"Deferreds" 通讯howtos: "TCP服务器","TCP客户端","UDP网络"和"使用进程"; 以及 "使用线程" There are multiple implementations of the reactor, each modified to provide better support for specialized features over the default implementation. More information about these and how to use a particular implementation is available via Choosing a Reactor. Reactor有很多各不同的实现,每个实现都在缺省实现的基础上对某些特性提供了更好的支持.更多的信息和关于如何使用这些特性参见"选择Reactor" Twisted applications can use the interfaces in twisted.application.service to configure and run the application instead of using boilerplate reactor code. See Using Application for an introduction to Application. Twisted应用程序可以使用twisted.application.service中提供的接口来配置和运行应用程序,而不是使用像reactor的示例代码那样去运行.更多介绍请参考"使用应用" == 使用reactor对象(Using the reactor object) == You can get to the reactor object using the following code: 你可以通过如下代码得到reactor: {{{ from twisted.internet import reactor }}} The reactor usually implements a set of interfaces, but depending on the chosen reactor and the platform, some of the interfaces may not be implemented: Reactor通常实现了以下一组接口,但是根据选择的不同reactor和运行平台,一些接口可能没有实现: * IReactorCore: Core (required) functionality. * IReactorFDSet: Use FileDescriptor objects. * IReactorProcess: Process management. Read the Using Processes document for more information. * IReactorSSL: SSL networking support. * IReactorTCP: TCP networking support. More information can be found in the Writing Servers and Writing Clients documents. * IReactorThreads: Threading use and management. More information can be found within Threading In Twisted. * IReactorTime: Scheduling interface. More information can be found within Scheduling Tasks. * IReactorUDP: UDP networking support. More information can be found within UDP Networking. * IReactorUNIX: UNIX socket support. * IReactorCore: 必需的核心功能 * IReactorFDSet: 使用文件描述符对象 * IReactorProcess: 进程管理,详细信息参见"使用进程" * IReactorSSL: SSL支持 * IReactorTCP: TCP网络支持,详细信息参见"编写服务器"和"编写客户端" * IReactorThreads: 线程使用和管理. 详细信息参见"Twisted中的线程" * IReactorTime: 调度接口.更多信息参见"调度任务" * IReactorUDP: UDP支持.更多信息参见"UDP网络" * IReactorUNIX: UNIX socket支持. 翻译 -- Jerry Marx 7/30/2004 返回 PyTwisted/LowLevelNetworkingEventLoop Version: 1.3.0