Pushing/Polling

Pushing/Polling
Push technologyFrom Wikipedia, the free encyclopediaJump to: navigation, search 

Not to be confused with Push–pull technology.
This article's lead section may not adequately summarize all of its contents. Please consider expanding the lead to provide an accessible overview of all of the article's key points. (September 2012) 

Push, or server push, describes a style of Internet-based communication where the request for a given transaction is initiated by the publisher or central server. It is contrasted with pull, where the request for the transmission of information is initiated by the receiver or client.

Contents [hide]
1 General use
2 Coding
2.1 HTTP server push
2.2 Pushlet
2.3 Long polling
2.4 Flash XMLSocket relays
2.5 Other coding
3 See also
4 References
5 External links


[edit] General usePush services are often based on information preferences expressed in advance. This is called a publish/subscribe model. A client might "subscribe" to various information "channels". Whenever new content is available on one of those channels, the server would push that information out to the user.

Synchronous conferencing and instant messaging are typical examples of push services. Chat messages and sometimes files are pushed to the user as soon as they are received by the messaging service. Both decentralised peer-to-peer programs (such as WASTE) and centralised programs (such as IRC or XMPP) allow pushing files, which means the sender initiates the data transfer rather than the recipient.

Email may also be a push system: the SMTP protocol is a push protocol (see Push e-mail). However, the last step —from mail server to desktop computer— typically uses a pull protocol like POP3 or IMAP. Modern e-mail clients make this step seem instantaneous by repeatedly polling the mail server, frequently checking it for new mail. The IMAP protocol includes the IDLE command, which allows the server to tell the client when new messages arrive. The original BlackBerry was the first popular example of push code for email in a wireless context.[citation needed]

Another popular type of Internet push code was PointCast Network, which gained popularity in the 1990s. It delivered news and stock market data. Both Netscape and Microsoft integrated it into their software at the height of the browser wars, but it later faded away and was replaced in the 2000s with RSS (a pull code).

Other uses are push enabled web applications including market data distribution (stock tickers), online chat/messaging systems (webchat), auctions, online betting and gaming, sport results, monitoring consoles and sensor network monitoring.

[edit] Coding[edit] HTTP server pushHTTP server push (also known as HTTP streaming) is a mechanism for sending data from a web server to a web browser. HTTP server push can be achieved through several mechanisms.

Generally the web server does not terminate a connection after response data has been served to a client. The web server leaves the connection open so that if an event is received, it can immediately be sent to one or multiple clients. Otherwise the data would have to be queued until the client's next request is received. Most web servers offer this functionality via CGI (e.g. Non-Parsed Headers scripts on Apache).

Another mechanism is related to a special MIME type called multipart/x-mixed-replace, which was introduced by Netscape in 1995. Web browsers would interpret this as a document changing whenever the server felt like pushing a new version to the client.[1] It is still supported by Firefox, Opera and Safari today, but ignored by Internet Explorer.[2] It can be applied to HTML documents, and also for streaming images in webcam applications.

The WHATWG Web Applications 1.0 proposal[3] included a mechanism to push content to the client. On September 1, 2006, the Opera web browser implemented this new experimental coding in a feature called "Server-Sent Events".[4][5] It is now being standardized as part of HTML5.[6] Another related part of HTML5 is the WebSockets API, which allows a web server and client to communicate over a full-duplex TCP connection.

[edit] PushletIn this technique, the server takes advantage of persistent HTTP connections and leaves the response perpetually "open" (i.e. it never terminates the response), effectively fooling the browser into continuing in "loading" mode after the initial page load would normally be complete. The server then periodically sends snippets of JavaScript to update the content of the page, thereby achieving push capability. By using this technique the client doesn't need Java applets or other plug-ins to keep an open connection to the server. The clients will be automatically notified by new events, pushed by the server.[7][8] One serious drawback to this method, however, is the lack of control the server has over the browser timing out. A page refresh is always necessary if a timeout occurs on the browser end.

[edit] Long pollingLong polling is a variation of the traditional polling technique and allows emulation of an information push from a server to a client. With long polling, the client requests information from the server in a similar way to a normal poll. However, if the server does not have any information available for the client, instead of sending an empty response, the server holds the request and waits for some information to be available. Once the information becomes available (or after a suitable timeout), a complete response is sent to the client. The client will normally then immediately re-request information from the server, so that the server will almost always have an available waiting request that it can use to deliver data in response to an event. In a web/AJAX context, long polling is also known as Comet programming.

Long polling is itself not a true push, but can be used under circumstances where a real push is not possible, and offers many of the same benefits in terms of rapid delivery. For example, BOSH is a popular long polling alternative to TCP, used when TCP is difficult or impossible (e.g. in a web browser).[9]

[edit] Flash XMLSocket relaysThis technique, used by Cbox and other chat applications, makes use of the XMLSocket object in a single-pixel Adobe Flash movie. Under the control of JavaScript, the client establishes a TCP connection to a unidirectional relay on the server. The relay server does not read anything from this socket; instead it immediately sends the client a unique identifier. Next, the client makes an HTTP request to the web server, including with it this identifier. The web application can then push messages addressed to the client to a local interface of the relay server, which relays them over the Flash socket. The advantage of this approach is that it appreciates the natural read-write asymmetry that is typical of many web applications, including chat, and as a consequence it offers high efficiency. Since it does not accept data on outgoing sockets, the relay server does not need to poll outgoing TCP connections at all, making it possible to hold open tens of thousands of concurrent connections. In this model, the limit to scale is the TCP stack of the underlying server operating system.

[edit] Other codingThe term Comet has been used to describe push technologies applied to Ajax web applications. It is used as an umbrella term for a combination of web technologies such as HTTP server push and long polling (see above).

XMPP is often used for push applications as well, especially the PubSub extensions. Apple uses this code for its iCloud push support.

BOSH is a long-lived HTTP technique used in XMPP, but that can be used on the web. The specification (XEP-0124: Bidirectional-streams Over Synchronous HTTP (BOSH)) reads: This specification defines a transport protocol that emulates the semantics of a long-lived, bidirectional TCP connection between two entities (such as a client and a server) by efficiently using multiple synchronous HTTP request/response pairs without requiring the use of frequent polling or chunked responses.

































The push–pull technology is a strategy for controlling agricultural pests by using repellent "push" plants and trap "pull" plants. For example, cereal crops like maize or sorghum are often infested by stem borers. Grasses planted around the perimeter of the crop attract and trap the pests, whereas other plants, like Desmodium, planted between the rows of maize repel the pests and control the parasitic plant Striga. Push–pull technology was developed at the International Centre of Insect Physiology and Ecology (ICIPE) in Kenya in collaboration with Rothamsted Research, UK [1]and national partners.

Contents [hide]
1 Pests of cereal crops
2 The pull
3 The push
4 How push–pull works
5 See also
6 References
7 External links


[edit] Pests of cereal cropsStemborers, parasitic striga weeds and poor soil fertility are the three main constraints to efficient production of cereals in sub-Saharan Africa. Losses caused by stemborers can reach as high as 80% in some areas and an average of about 15-40% in others. Losses attributed to striga weeds, on the other hand, range between 30% and 100% in most areas, and are often exacerbated by the low soil fertility prevalent in the region. The soils are highly degraded due to continuous cropping with limited or no external inputs to improve soil fertility. When the two pests occur together, farmers often lose their entire crops. Crop losses caused by stemborers and striga weeds amount to about US$ 7 billion annually, affecting mostly the resource-poor subsistence farmers.

Control of stemborers using pesticides is not only expensive and harmful to the environment, but also usually ineffective, as the chemicals cannot reach deep inside the plant stems where stemborer larvae reside. Similarly, the use of herbicides against striga is neither effective nor feasible among smallholders in the region for both biological and socioeconomic reasons. Preventing crop losses from stemborers and striga weeds, and improving soil fertility in eastern Africa alone could increase cereal harvests enough to feed an additional 27 million people in the region

[edit] The pullThe approach relies on a combination of companion crops to be planted around and among maize or sorghum. Both domestic and wild grasses can help to protect the crops by attracting and trapping the stemborers. The grasses are planted in the border around the maize and sorghum fields where invading adult moths become attracted to chemicals emitted by the grasses themselves. Instead of landing on the maize or sorghum plants, the insects head for what appears to be a tastier meal. These grasses provide the "pull" in the "push–pull" strategy. They also serve as a haven for the borers' natural enemies. Good trap crops include well-known grasses such as Napier grass (Pennisetum purpureum) and Sudan grass (Sorghum vulgare sudanense). Napier grass has a particularly effective way of defending itself against the pests: once attacked by a borer larva, it secretes a sticky substance which physically traps the pest and limits its damage.

[edit] The pushThe "push" in the intercropping scheme is provided by the plants that emit chemicals (kairomones) which repel stemborer moths and drive them away from the main crop (maize or sorghum). The best candidates discovered so far with the repellent properties are species of leguminous genus Desmodium. Desmodium is planted in between the rows of maize or sorghum. Being a low-growing plant, it does not interfere with the crops' growth and, furthermore, has the advantage of maintaining soil stability, improving soil fertility through enhanced soil organic matter content and nitrogen fixation. It also serves as a highly nutritious animal feed and effectively suppresses striga weeds. Another plant showing good repellent properties is molasses grass (Melinis minutiflora), a nutritious animal feed with tick-repelling and stemborer larval parasitoid attractive properties.

[edit] How push–pull works This section does not cite any references or sources. (December 2011)

The push–pull technology involves use of behaviour-modifying stimuli to manipulate the distribution and abundance of stemborers and beneficial insects for management of stemborer pests. It is based on in-depth understanding of chemical ecology, agrobiodiversity, plant-plant and insect-plant interactions, and involves intercropping a cereal crop with a repellent intercrop such as Desmodium (push), with an attractive trap plant such as Napier grass (pull) planted as a border crop around this intercrop. Gravid stemborer females are repelled from the main crop and are simultaneously attracted to the trap crop. Napier grass produces significantly higher levels of attractive volatile compounds (green leaf volatiles), cues used by gravid stemborer females to locate host plants, than maize or sorghum. There is also an increase of approximately 100-fold in the total amounts of these compounds produced in the first hour of nightfall by Napier grass (scotophase), the period at which stemborer moths seek host plants for laying eggs, causing the differential oviposition preference. However, many of the stemborer larvae, about 80%, do not survive, as Napier grass tissues produce sticky sap in response to feeding by the larvae, which traps them, causing their mortality. Legumes in the Desmodium genus (silverleaf, D. uncinatum and greenleaf, D. intortum), on the other hand, produce repellent volatile chemicals that push away the stemborer moths. These include (E)-ß-ocimene and (E)-4,8-dimethyl-1,3,7-nonatriene, semiochemicals produced during damage to plants by herbivorous insects and are responsible for the repellence of Desmodium to stemborers.

Desmodium also controls striga, resulting in significant yield increases of about 2 tonnes/hectare (0.9 short tons per acre) per cropping season. In the elucidation of the mechanisms of striga suppression by D. uncinatum, it was found that, in addition to benefits derived from increased availability of nitrogen and soil shading, an allelopathic effect of the root exudates of the legume, produced independently of the presence of striga, is responsible for this dramatic reduction in an intercrop with maize. Presence of blends of secondary metabolites with striga seed germination stimulatory, 4′′,5′′,-dihydro-5,2′,4′-trihydroxy-5′′,-isopropenylfurano-(2′′,3′′;7,6)-isoflavanone, and postgermination inhibitory, 4′′,5′′-dihydro-2′-methoxy-5,4′-dihydroxy-5′′-isopropenylfurano- (2′′,3′′;7,6)-isoflavanone, activities in the root exudates of D. uncinatum which directly interferes with parasitism was observed. This combination thus provides a novel means of in situ reduction of the striga seed bank in the soil through efficient suicidal germination even in the presence of grassy host plants in the proximity. Other Desmodium species have also been evaluated and have similar effects on stemborers and striga weed and are currently being used as intercrops in maize, sorghum and millets.[2]

你可能感兴趣的:(pushing/pulling)