Content deleted Content added
m →Applications using Twisted: HTTP to HTTPS for Blogspot |
|||
(45 intermediate revisions by 40 users not shown) | |||
Line 1:
{{Short description|Event-driven network programming framework}}
{{Infobox software
| name = Twisted
| logo =
| screenshot =
| caption =
| collapsible =
| author = [[Glyph Lefkowitz]]
| developer = Community
| released = {{Start date and age|2002|10|22}}<ref>{{Cite mailing list|last=Shtull-Trauring|first=Itamar|title=Twisted 1.0|date=2002-10-22|
| latest release version = {{wikidata|property|edit|reference|P348}}
| latest release date = {{start date and age|{{wikidata|qualifier|P348|P577}}}}
| latest preview version =
| latest preview date =
Line 16 ⟶ 19:
| size =
| language =
▲| status = Mature
| genre = [[event-driven programming|Event-driven]] [[computer network programming|networking]]
| license = [[MIT License]]
}}
'''Twisted''' is an [[event-driven programming|event-driven]] [[computer network programming|network programming]] [[software framework|framework]] written in [[Python (programming language)|Python]] and licensed under the [[MIT License]].
Twisted projects variously support [[Transmission Control Protocol|TCP]], [[User Datagram Protocol|UDP]], [[Transport Layer Security|SSL/TLS]], [[IP multicast]], Unix ___domain [[Unix ___domain socket|sockets]],
==Core ideas==
===Separation of protocols and transports===
Twisted is designed for complete separation between logical protocols (usually relying on stream-based connection semantics, such as HTTP or [[POP3]]) and
===Deferreds===
Central to the Twisted application model is the concept of a ''deferred'' (elsewhere called a ''[[future (programming)|future]]''). A deferred is an instance of a class designed to receive and process a result which has not been computed yet, for example because it is based on data from a remote peer. Deferreds can be passed around, just like regular objects, but cannot be asked for their value. Each deferred supports a callback chain. When the deferred gets the value, it is passed to the functions on the callback chain, with the result of each callback becoming the input for the next. Deferreds make it possible
For example, if a deferred returns a string from a remote peer containing an [[IP address]] in quad format, a callback can be attached to translate it into a 32-bit number. Any user of the deferred can now treat it as a deferred returning a 32-bit number. This, and the related ability to define "errbacks" (callbacks which are called as error handlers), allows code to specify in advance what to do when an asynchronous event occurs, without stopping to wait for the event. In non-event-driven systems, for example using [[thread (computing)|threads]], the operating system incurs premature and additional overhead organizing threads each time a blocking call is made. ===Thread support===
Line 38 ⟶ 41:
===Foreign loop support===
Twisted can integrate with foreign event loops, such as those of [[GTK+]], [[Qt (framework)|Qt]] and [[Cocoa (API)|Cocoa]] (through [[PyObjC]]). This allows using Twisted as the
==Applications using Twisted==
{{More citations needed section|date=March 2017}}
* The [[BuildBot]] continuous-integration system relies on Twisted for client/server communication.<ref>
* [[ITA Software]] has developed an airline-reservation system for [[Air Canada]] that uses Twisted extensively.<ref>
* [[
* Twisted was used in the [[Omegle]] one-on-one chat service<ref>
* The Apple Calendar Server uses Twisted,<ref>
* [[Conch (SSH)|Conch]], an implementation of the [[Secure Shell]] (SSH) protocol
* The original version of social networking and microblogging site [[Jaiku]] used Twisted.{{Citation needed|date=March 2017}}
* [[
* The file-hosting service [[Ubuntu One]] used Twisted.
* [[Tor2web]], an HTTP proxy for [[Tor (anonymity network)#Hidden services|Tor Hidden Services (HS)]], uses Twisted.
* [[GlobaLeaks]], an open-source whistleblowing framework, uses Twisted.
* [[Cloudkick]], a cloud-server management web-application, used Twisted. It now has been rewritten using [[Node.js]].
* [[Twilio]], a cloud telephony provider, uses Twisted.
* [[
*
*
* [[
* [[Scrapy]], a web crawler based on Twisted.
* [[Listen to Wikipedia]], a [[Wikipedia]] audio-visualizer, uses Twisted to broadcast real-time edit events to browsers.<ref>{{Citation|title=A WebSocket-oriented monitor for Wikipedia (also, wikimon, wikital monsters)|date=2017-09-03|url=https://github.com/hatnote/wikimon|publisher=hatnote|access-date=2017-09-21}}</ref>
* [[Tahoe-LAFS]], a distributed data store and distributed file system.
* [[Deluge (software)|Deluge]], a highly modular [[BitTorrent]] client, uses Twisted.<ref>{{cite web|url=https://dev.deluge-torrent.org/wiki/Installing/Source|title=Deluge: build from source|website=dev.deluge-torrent.org|access-date=2020-01-08}}</ref>
* [[Magic Wormhole]], a secure file transfer tool using [[Password-authenticated key agreement|PAKE]].<ref>{{cite web|url=https://github.com/warner/magic-wormhole|title=Magic Wormhole|website=github.com}}</ref>
===Nevow===
{{Infobox software
| title =
| name = Nevow
| logo = <!-- [[File: ]] -->
| screenshot = <!-- [[File: ]] -->
| caption =
| collapsible =
| author = Donovan Preston<ref>[https://www.python.org/pycon/dc2004/papers/60/context this 2004 paper by Donovan Preston, the original author of Nevow and Formless] {{webarchive |url=https://web.archive.org/web/*/https://www.python.org/pycon/dc2004/papers/60/context |date=* }}</ref><ref>[http://soundfarmer.com/content/nevow.html Nevow: A Web Application Construction Kit], Donovan Preston</ref><ref>[http://article.gmane.org/gmane.comp.python.twisted/4973/ Subject: Re: ANN: Twisted 1.1.0, the framework of *your* internet], From: Donovan Preston, Date: 2003-10-27, Newsgroups: gmane.comp.python.twisted, ''nevow was originally a research project -- a weekend's worth of hacking whose benefits turned out to be so great that we decided to focus on bringing it up to a usable state for Quotient as soon as possible. And that's where it is now.''</ref>
| developer = Divmod
| released = {{Start date and age|2004|05|06}}<!-- from changelog *nevow-0.1 (06 May 2004) -->
| discontinued =
| latest release version = 0.14.4
| latest release date = {{Start date and age|2018|06|14}}<ref name="release">{{cite web | url=https://github.com/twisted/nevow/releases | title= Releases · twisted/nevow | website= [[GitHub]] | access-date=2020-11-04 }}</ref>
| latest preview version =
| latest preview date = <!-- {{Start date and age|YYYY|MM|DD}} -->
| programming language = [[Python (programming language)|Python]]
| operating system = [[Cross-platform]]
| platform =
| size =
| language =
| genre = [[Web application framework]]
| license = [[MIT License]]
}}
'''Nevow''' (pronounced like the French ''nouveau'') is a [[Python (programming language)|Python]] [[web application framework]] originally developed by the company Divmod. Template substitution is achieved via a small [[Tag Attribute Language]], which is usually embedded in on-disk [[XML]] templates, though there is also a pure-Python [[___domain-specific language]] called Stan, for expressing this markup programmatically. Nevow integrates well with Twisted.
Nevow was deployed on several high-profile [[web site]]s, most notably the official Python site.<ref>[https://wiki.python.org/moin/PythonWebsitePyramidDocs PythonWebsitePyramidDocs], ''Pyramid is the internal website templating system used to build the python.org pages. (It is not connected to the Pyramid web framework, formerly named BFG, that's used with Pylons.) Pyramid uses Nevow as its templating system and YAML as the format for its file based data'' - PythonInfo Wiki, python.org</ref>
As of mid-2010, Divmod went out of business,<ref>[http://glyph.twistedmatrix.com/2009/07/goodbye-divmod-hello-world.html Goodbye, Divmod. Hello, World!], July 10, 2009, Deciphering Glyph</ref> causing development work on Nevow to all but cease, and in 2011 its homepage was no longer accessible.<ref>[https://www.ohloh.net/p/nevow/commits Divmod Nevow commits] {{Webarchive|url=https://web.archive.org/web/20121015131618/https://www.ohloh.net/p/nevow/commits |date=2012-10-15 }} on [[Ohloh]]</ref> There is a project on [[Launchpad (website)|Launchpad]], hosting the source code of Divmod<ref>[http://divmod.org Divmod] {{webarchive|url=https://web.archive.org/web/20060813135423/http://divmod.org/ |date=August 13, 2006 }}</ref> including the source code of the Nevow project.<ref>[https://launchpad.net/divmod.org Divmod] on [[Launchpad (website)|Launchpad]]</ref>
==== Athena ====
Athena is a Nevow component which facilitates bi-directional, [[asynchronous communication]] between the Python and [[JavaScript]] portions of a web application in the form of [[remote procedure call]]s. This technique is typically called [[Ajax (programming)|Ajax]] or [[Comet (programming)|Comet]], though Nevow's implementation predates both of these labels.<ref>[http://divmodsphinx.funsize.net/nevow/chattutorial/#history History] {{Webarchive|url=https://web.archive.org/web/20160303203811/http://divmodsphinx.funsize.net/nevow/chattutorial/#history |date=2016-03-03 }}, Nevow Athena from Scratch, or The Evolution of a Chat Application — Divmod Nevow vtrunk documentation</ref> Athena also includes an [[inheritance (object-oriented programming)|inheritance]]-based JavaScript [[object system]], which forms the basis of a client-side ''[[GUI widget|widget]]'' abstraction, [[module (programming)|module system]] and in-[[web browser|browser]] [[unit test]]ing kit.
==See also==
{{Portal|Free and open-source software}}
* [[Application server]]
* [[Reactor pattern]]
* [[Perl Object Environment]], a comparable framework for the [[Perl]] programming language
* [[Netty (software)|Netty]], for the Java programming language
* [[Node.js]], for Javascript
* [[EventMachine]], an event-processing library for [[Ruby (programming language)|Ruby]]<ref>{{cite web |url=http://rubyeventmachine.com/ |title=EventMachine |
* [[Kivy (framework)]], a multi-platform GUI framework (including iOS and Android)<ref>{{cite web|url=http://kivy.org/docs/guide/other-frameworks.html|title=Integrating with other Frameworks — Kivy 1.11.0.dev0 documentation|website=kivy.org}}</ref>
==References==
Line 80 ⟶ 121:
[[Category:Free software programmed in Python]]
[[Category:Free system software]]
[[Category:Python (programming language) libraries]]
[[Category:Python (programming language) software]]
[[Category:Software using the MIT license]]
|